-
-
Notifications
You must be signed in to change notification settings - Fork 78.8k
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
Dropdown: refine handling of keydown in input and textarea #21802
Conversation
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.
LGTM 👍
But we have to review this #21535 first
Can you update your branch @vanduynslagerp ? Thank you 👍 |
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.
Your unit test failed because of the lack of .dropdown-item
and li
isn't focusable without tabindex="1"
With this HTML everything is fine :
<ul class="tabs">
<li class="dropdown">
<input type="text" id="input" data-toggle="dropdown">
<ul class="dropdown-menu" role="menu">
<li id="item1" tabindex="1" class="dropdown-item"><a href="#">Secondary link</a></li>
<li id="item2" tabindex="1" class="dropdown-item"><a href="#">Something else here</a></li>
<li class="divider"/>
<li tabindex="1" class="dropdown-item"><a href="#">Another link</a></li>
</ul>
</li>
</ul>
@Johann-S I pushed the class name change but tests are still failing. Any chance you could take a look? |
Superseded by : #24557 |
// - And not a key in REGEXP_KEYDOWN => not a dropdown command | ||
// If input/textarea: | ||
// - If space key => not a dropdown command | ||
// - If key is other than excape |
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.
escape
Fixes #21366
This PR handle better the key inputs in
input
andtextarea
withindropdown
anddropdown-menu
.As a side note, keyboard navigation is current broken and the fix is here #21535.
This PR will be fully working only when #21535 lands.
Here is the new behaviors.
input
andtextarea
within adropdown-menu
:input
ortextarea
)input
ortextarea
input
ortextarea
input
ortextarea
input
andtextarea
within adropdown
but outside of thedropdown-menu
:dropdown-item
in the menudropdown-item
in the menuinput
ortextarea
input
ortextarea