fix(ui): search in select fields with filterOptions (#13397)

Fixes https://github.com/payloadcms/payload/issues/13236
This commit is contained in:
Sasha
2025-08-07 16:57:56 +03:00
committed by GitHub
parent e870be094e
commit c9a1590fc4
2 changed files with 14 additions and 2 deletions

View File

@@ -110,4 +110,16 @@ describe('Select', () => {
await field.click({ delay: 100 })
await expect(options.locator('text=One')).toBeHidden()
})
test('should retain search when reducing options', async () => {
await page.goto(url.create)
const field = page.locator('#field-selectWithFilteredOptions')
await field.click({ delay: 100 })
const options = page.locator('.rs__option')
await expect(options.locator('text=One')).toBeVisible()
await expect(options.locator('text=Two')).toBeVisible()
await field.locator('input').fill('On')
await expect(options.locator('text=One')).toBeVisible()
await expect(options.locator('text=Two')).toBeHidden()
})
})