Skip to content

Customizable useSelect input debounce wait#1533

Open
tpict wants to merge 1 commit intodownshift-js:masterfrom
tpict:customizable-clear-timeout
Open

Customizable useSelect input debounce wait#1533
tpict wants to merge 1 commit intodownshift-js:masterfrom
tpict:customizable-clear-timeout

Conversation

@tpict
Copy link

@tpict tpict commented Aug 30, 2023

What: The hard-coded 500ms wait until useSelect's input is cleared is being changed to a customizable prop.

Why: So this behavior can be customized or opted out of.

How: Replaced the hard-coded number with a prop. If the customized value is below zero, the value won't be cleared at all.

Checklist:

  • Documentation
  • Tests
  • TypeScript Types
  • Flow Types
  • Ready to be merged

Let me know what you think, and I can write docs etc if needed 🙂

@silviuaavram
Copy link
Collaborator

Hi @tpict !

I can understand the need for having a custom value option instead of the hardcoded 500ms, but I don't understand the need to never clear the search query. Once you start typing stuff, but mistyped something, or just want to start typing for something else, you will never be able to do it, consequently you will get stuck and unable to use the character keys to search for anything, unless you remount the component.

Can you describe the use case better, please? Thanks!

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.

2 participants