PokemonWorkshop/PokemonStudio

Select research should work even if there are accents

Closed this issue · 2 comments

As a User
I would like the Select research to work even if there are accents in what I typed
So that I'll be able to search for data even if they contain accents in their name

Context

This is a regression due to the new implemented Select.
For example, Mâchouille should be found even if I only type Machouille in French.

Acceptance criterias

  • Add this behaviour to @designSystem/Select

We can use this function:

const normalize = (str: string) => {
  return str
    .normalize('NFD')
    .replace(/\p{Diacritic}/gu, '')
    .toLowerCase();
};

Example:

const result = normalize('Mâchouille');
console.log(result); // machouille

Please make sure it's properly applied to @designSystem/Select