PokemonWorkshop / PokemonStudio

Pokémon Studio is a monster taming game editor which helps you to bring your ideas to life, in just a few clicks.
https://pokemonworkshop.com/
Other
93 stars 5 forks source link

Select research should work even if there are accents #306

Open AerunDev opened 1 month ago

AerunDev commented 1 month ago

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

Palbolsky commented 1 month ago

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
NuriYuri commented 1 month ago

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