Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/internal/components/option/highlight-match.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ interface HighlightMatchProps {
highlightText?: string;
}

const Highlight = ({ str }: HighlightMatchProps) =>
str ? <span className={styles['filtering-match-highlight']}>{str}</span> : null;
function Highlight({ str }: HighlightMatchProps) {
return str ? <mark className={styles['filtering-match-highlight']}>{str}</mark> : null;
}

export default function HighlightMatch({ str, highlightText }: HighlightMatchProps) {
if (!str || !highlightText) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ describe('Property filter autosuggest', () => {
expect(wrapper.findDropdown().findOption(1)!.getElement()).toHaveTextContent('abc');
});
test('is used for highlighting', () => {
expect(wrapper.findDropdown().findHighlightedMatches()[0].getElement()).toHaveTextContent('abc');
const highlightMatch = wrapper.findDropdown().findHighlightedMatches()[0].getElement();
expect(highlightMatch.tagName).toBe('MARK');
expect(highlightMatch).toHaveTextContent('abc');
});
test('is not used for the enteredText- option', () => {
expect(wrapper.findEnteredTextOption()!.getElement()).toHaveTextContent('123');
Expand Down
Loading