Skip to content

Autocomplete menu closes when typing characters without accents for accented label or filterText #722

@ygcarvalh

Description

@ygcarvalh

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 typing i in epossivel.
  • I tried using a validFor function that normalizes both user input and filterText, 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions