-
-
Notifications
You must be signed in to change notification settings - Fork 7
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: add retainFocus config parameter #83
feat: add retainFocus config parameter #83
Conversation
Hello @rambah , I understand what you are trying to achieve here, but this is not a good practice and is also not good in terms of UX. |
Hi @niketpathak, thank you for your feedback. I understand your concern regarding user experience. However, the motivation behind this change, comes from a specific use case where rapid form filling is critical. In workflows where speed and efficiency are essential, like for trained professionals, users often prefer to trust their input and minimize the number of keystrokes needed to fill out a form. (Imagine a form with about 7 typeahead input fields... the number of The proposed change does not aim to replace the current behavior but rather provide an option for those who need it. By setting the config param to |
hmmm. I see your point @rambah. I also agree the number of keystrokes is doubled albeit its the same key. Nonetheless, let me ponder on that for a bit to see if I can come up with something more elegant. will get back to you when able. Thanks again for your input/contribution. |
@niketpathak We can also work together on that issue. Just tell me if you got an idea on how to improve that solution :) |
@niketpathak We could change the name from
|
Hello @rambah , thank you for taking the time for this and sorry about the delay. I cannot think of a better solution than proposed by you. Although the name |
Hi @niketpathak, alright, thanks. I will change it accordingly and update PR. :) |
@niketpathak Updated. |
What kind of change does this PR introduce?
Does this PR introduce a breaking change?
Other information:
This PR introduces a new configuration parameter,
preventDefaultTabKeyWhenListOpen
, which controls the behavior of the Tab key when the list of suggestions is open.New Feature: preventDefaultTabKeyWhenListOpen
This feature allows users to customize how the Tab key behaves when the suggestions list is open.
Default Behavior:
New Configuration Option:
false
, pressing the Tab key will select the first suggestion and immediately move the focus to the next element on the page.By default, this option is set to true, preserving the existing behavior.
See video for explanation:
preventDefaultTabKeyWhenListOpen set to
true
(default):Here you can see, that you have to press twice the 'Tab' key to move the focus to the next element.
Screen.Recording.2024-06-26.at.15.15.26.mov
preventDefaultTabKeyWhenListOpen set to
false
:Here you only have to press once the 'Tab' key to move the focus to the next element of the page.
Screen.Recording.2024-06-26.at.15.14.48.mov