-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: Auto call onAddNew when the user searchs and there is no match #1070
Conversation
83c0c8a
to
7f8f211
Compare
useEffect(() => { | ||
if (!debouncedSearch || !onAddNew) return; | ||
if (filteredOptions.length === 1 && filteredOptions[0] === addNewOption) onAddNew(debouncedSearch); | ||
}, [debouncedSearch, filteredOptions, onAddNew]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thought: This feels like we're assuming too much. It's possible the user has a typo, or just wants to see what options are available. They may not want to go straight to the Add New callback.
question: Is this coming from product feedback?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with you, feels too much. But also the user can hit ESC or the x
icon to go back to select mode
This was an ask from Dave.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if I have a typo, then I'll automatically move to the "Add new" text field. I'll try to hit backspace to fix my input, but then I'm no longer in the select field. As a user I'll have to understand that not matching anything in the list will automatically change my field. And then know that I can return to the list by the two methods you described.
I don't think that is going to be clear to our users.
I disagree with the purposed UX and I think it's going to make for a poor user experience. If this is really want Dave wants and thinks that it is the correct thing, then let's push it through.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll talk to Dave about it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙈
7f8f211
to
d647544
Compare
This change allow us to automatically switch to
Add mode
when the user search and there are not matches in the provided options