diff --git a/src/internal/components/option/__tests__/option.test.tsx b/src/internal/components/option/__tests__/option.test.tsx index e34fef8297..7d7c7047c0 100644 --- a/src/internal/components/option/__tests__/option.test.tsx +++ b/src/internal/components/option/__tests__/option.test.tsx @@ -305,10 +305,10 @@ describe('Option component', () => { test('skips highlighting if the label text is too long', () => { const optionWrapper = renderOption({ option: { - label: 'a'.repeat(1000000), + label: 'a'.repeat(100000), value: '1', }, - highlightText: 'a'.repeat(500000), + highlightText: 'a'.repeat(50000), }); checkMatches(optionWrapper, 0, ''); }); diff --git a/src/internal/components/option/highlight-match.tsx b/src/internal/components/option/highlight-match.tsx index ba3e9e82b1..efc4a39671 100644 --- a/src/internal/components/option/highlight-match.tsx +++ b/src/internal/components/option/highlight-match.tsx @@ -7,7 +7,7 @@ import styles from './styles.css.js'; const splitOnFiltering = (str: string, highlightText: string) => { // We match by creating a regex using user-provided strings, so we skip // highlighting if the generated regex would be too memory intensive. - if (highlightText.length > 100000) { + if (highlightText.length > 10_000) { return { noMatches: [str], matches: null }; }