Skip to content

Commit a07cb91

Browse files
Fix typeaheads suggestions (#148)
This PR aims to fix the typeaheads suggestions in order to look for the entire input value inside the options when making the parts bold.
1 parent 95e04f3 commit a07cb91

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Fixed
11+
12+
- `StaticTypeaheadInput` and `AsyncTypeaheadInput` highlighted suggestions, in order to match the entire word of the input value.
13+
1014
## [3.11.0] - 2025-09-29
1115

1216
### Added

src/lib/helpers/typeahead.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ const renderHighlightedOptionFunction = (
9191

9292
const getAutosuggestHighlightParts = (option: TypeaheadOption, inputValue: string): Array<{ text: string; highlight: boolean }> => {
9393
const finalOption = typeof option === "string" ? option : option.label;
94-
const matches = AutosuggestHighlightMatch(finalOption, inputValue, { insideWords: true });
94+
const matches = AutosuggestHighlightMatch(finalOption, inputValue, { insideWords: true, requireMatchAll: true });
9595
return AutosuggestHighlightParse(finalOption, matches);
9696
};
9797

0 commit comments

Comments
 (0)