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

Fix clear input on blur when no match #695

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

achrafmohye
Copy link
Contributor

No description provided.

@emersion
Copy link
Member

emersion commented Nov 8, 2024

Sounds like a good idea to me.

@achrafmohye achrafmohye marked this pull request as ready for review November 20, 2024 14:29
@achrafmohye achrafmohye requested a review from a team as a code owner November 20, 2024 14:29
Copy link
Contributor

@RomainValls RomainValls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, tested in osrd ✅

@@ -198,8 +198,7 @@ const ComboBox = <T,>({
} else if (!isInputInSuggestions && selectedOption) {
setInputValue(getSuggestionLabel(selectedOption));
} else if (!isInputInSuggestions) {
setInputValue('');
setSelectedOption(null);
clearInput();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clearInput() will focusInput() at the end. This is confusing for users: they've navigated away from the input (either by clicking outside, or with Tab, or something else), but then focus is set back to the input.

@emersion
Copy link
Member

The commit name has the "front: " prefix, but it should be "ui-core: ". Also it would be nice to mention that this is about the ComboBox component.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants