diff --git a/src/property-filter/__tests__/property-filter.filtering-input.test.tsx b/src/property-filter/__tests__/property-filter.filtering-input.test.tsx index 12c747dfdb..98641b3f51 100644 --- a/src/property-filter/__tests__/property-filter.filtering-input.test.tsx +++ b/src/property-filter/__tests__/property-filter.filtering-input.test.tsx @@ -409,6 +409,15 @@ describe('count text', () => { }); expect(wrapper.findResultsCount()!.getElement()).toHaveTextContent('5 matches'); }); + + test('is visible when there is at least 1 token group', () => { + const { propertyFilterWrapper: wrapper } = renderComponent({ + enableTokenGroups: true, + countText: '5 matches', + query: { operation: 'or', tokens: [], tokenGroups: [{ propertyKey: 'string', value: 'first', operator: ':' }] }, + }); + expect(wrapper.findResultsCount()!.getElement()).toHaveTextContent('5 matches'); + }); }); describe('constraint text', () => { diff --git a/src/property-filter/internal.tsx b/src/property-filter/internal.tsx index 34a389c74c..7ebdb9be88 100644 --- a/src/property-filter/internal.tsx +++ b/src/property-filter/internal.tsx @@ -113,7 +113,6 @@ const PropertyFilterInternal = React.forwardRef( const i18nStrings = usePropertyFilterI18n(rest.i18nStrings); useImperativeHandle(ref, () => ({ focus: () => inputRef.current?.focus() }), []); - const showResults = !!query.tokens?.length && !disabled && !!countText; const [filteringText, setFilteringText] = useState(''); const { internalProperties, internalOptions, internalQuery, internalFreeText } = (() => { @@ -306,6 +305,9 @@ const PropertyFilterInternal = React.forwardRef( const textboxAriaDescribedBy = filteringConstraintText ? joinStrings(rest.ariaDescribedby, constraintTextId) : rest.ariaDescribedby; + + const showResults = !!internalQuery.tokens?.length && !disabled && !!countText; + return (