Skip to content

Commit e86ab94

Browse files
committed
feat: enable client-side filtering of property options when editing a PropertyFilter token
1 parent 2a71e86 commit e86ab94

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

src/property-filter/__tests__/property-filter-token-editor.test.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,22 @@ describe.each([false, true])('token editor, expandToViewport=%s', expandToViewpo
208208
).toEqual(['=Equals', '!=Does not equal', ':Contains', '!:Does not contain']);
209209
});
210210

211+
test('enables client-side filtering on property options', () => {
212+
renderComponent({
213+
query: { tokens: [{ propertyKey: 'string', value: 'first', operator: ':' }], operation: 'or' },
214+
});
215+
const editor = openEditor(0, { expandToViewport });
216+
act(() => editor.propertySelect().openDropdown());
217+
act(() => editor.propertySelect().findFilteringInput()!.setInputValue('str'));
218+
expect(
219+
editor
220+
.propertySelect()
221+
.findDropdown()
222+
.findOptions()
223+
.map(optionWrapper => optionWrapper.getElement().textContent)
224+
).toEqual(['string', 'string-other', 'string!=']);
225+
});
226+
211227
test('preserves fields, when one is edited', () => {
212228
renderComponent({
213229
disableFreeTextFiltering: true,

src/property-filter/token-editor-inputs.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export function PropertyInput({
6666
}
6767
return (
6868
<InternalSelect
69+
filteringType="auto"
6970
options={propertyOptions}
7071
selectedOption={
7172
property

0 commit comments

Comments
 (0)