From f18cb34687ca68f183ff414ceee61f35dae1ffbe Mon Sep 17 00:00:00 2001 From: Ian Caffey Date: Sun, 14 Sep 2025 20:56:32 -0500 Subject: [PATCH] feat: enable client-side filtering of property options when editing a PropertyFilter token (#3858) --- .../property-filter-token-editor.test.tsx | 16 ++++++++++++++++ src/property-filter/token-editor-inputs.tsx | 1 + 2 files changed, 17 insertions(+) diff --git a/src/property-filter/__tests__/property-filter-token-editor.test.tsx b/src/property-filter/__tests__/property-filter-token-editor.test.tsx index e7dec0ddc8..b0ab7c1ab8 100644 --- a/src/property-filter/__tests__/property-filter-token-editor.test.tsx +++ b/src/property-filter/__tests__/property-filter-token-editor.test.tsx @@ -208,6 +208,22 @@ describe.each([false, true])('token editor, expandToViewport=%s', expandToViewpo ).toEqual(['=Equals', '!=Does not equal', ':Contains', '!:Does not contain']); }); + test('enables client-side filtering on property options', () => { + renderComponent({ + query: { tokens: [{ propertyKey: 'string', value: 'first', operator: ':' }], operation: 'or' }, + }); + const editor = openEditor(0, { expandToViewport }); + act(() => editor.propertySelect().openDropdown()); + act(() => editor.propertySelect().findFilteringInput()!.setInputValue('str')); + expect( + editor + .propertySelect() + .findDropdown() + .findOptions() + .map(optionWrapper => optionWrapper.getElement().textContent) + ).toEqual(['string', 'string-other', 'string!=']); + }); + test('preserves fields, when one is edited', () => { renderComponent({ disableFreeTextFiltering: true, diff --git a/src/property-filter/token-editor-inputs.tsx b/src/property-filter/token-editor-inputs.tsx index a6de82e013..12ef2ce632 100644 --- a/src/property-filter/token-editor-inputs.tsx +++ b/src/property-filter/token-editor-inputs.tsx @@ -66,6 +66,7 @@ export function PropertyInput({ } return (