Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Focusing Select items with custom content by typing #2699

Open
diegohaz opened this issue Aug 7, 2023 Discussed in #2698 · 3 comments · May be fixed by #3298
Open

Focusing Select items with custom content by typing #2699

diegohaz opened this issue Aug 7, 2023 Discussed in #2698 · 3 comments · May be fixed by #3298
Labels

Comments

@diegohaz
Copy link
Member

diegohaz commented Aug 7, 2023

Discussed in #2698

Originally posted by Dremora August 7, 2023
In a Select example, once the select is open, one can type a letter to focus an item that starts with that letter.

I have a slightly modified version of this component that displays emojis in front of text. Typing to focus doesn't work anymore.

Is there any documentation on how this feature is implemented, and how to make it work with custom content?

@georgekaran
Copy link
Contributor

Hey @diegohaz

Just to clarify, do we want to allow users to customize typeahead behavior or ignore emojis at the beginning of text content?

@diegohaz
Copy link
Member Author

Hey @diegohaz

Just to clarify, do we want to allow users to customize typeahead behavior or ignore emojis at the beginning of text content?

Ideally, we would allow users to customize the behavior with a callback or something. I'm just not sure about the API. Do you have any idea?

@georgekaran
Copy link
Contributor

Ideally, we would allow users to customize the behavior with a callback or something. I'm just not sure about the API. Do you have any idea?

I was considering the following API, but I'm still uncertain about its name.

/**
 * The function that normalizes the text of an item. This is useful when the
 * text of an item is not the same as the text that should be matched.
 *
 * For example, if the text of an item includes an emoji, you may want to
 * normalize the text to remove the emoji.
 */
typeaheadNormalizeText?: (text: string) => string;

@georgekaran georgekaran linked a pull request Jan 4, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants