-
-
Notifications
You must be signed in to change notification settings - Fork 153
Description
I'm using a custom completion source with filterText and label, and I want to support matches that are case-insensitive and accent-insensitive. For example, I have the following completion:
{
label: '{ePossível}',
filterText: 'epossivel',
displayLabel: 'ePossível',
type: 'string'
}When I type:
- epossível → ✅ matches
- epossvel → ✅ matches
- epossivel → ❌ the autocomplete menu disappears after typing the i
This happens even though filterText is set correctly. I suspect the issue lies in how validFor is used internally.
The completion menu should remain open as long as the text typed by the user matches the filterText or label, even if accent marks are missing or characters differ slightly (e.g. e vs é). In my case, epossivel should continue to match {ePossível} through filterText.
What I tried
- I removed
validFor→ autocomplete doesn't appear at all. - I used
validFor: /[\p{L}\p{N}_]+/u→ still closes after typingiinepossivel. - I tried using a
validForfunction that normalizes both userinputandfilterText, but it seems the menu still disappears prematurely.
This issue only happens when trying to autocomplete accented labels from non-accented user input, which should match via filterText. It seems the internal logic closes the autocomplete menu when the input no longer matches the regex, even if the options still include a match after normalization.
Is there a recommended way to support accent-insensitive autocompletion?