Skip to content

Escape key should only close Dropdown#14722

Merged
fat merged 1 commit into
masterfrom
fat-14646
Oct 3, 2014
Merged

Escape key should only close Dropdown#14722
fat merged 1 commit into
masterfrom
fat-14646

Conversation

@fat

@fat fat commented Oct 3, 2014

Copy link
Copy Markdown
Member

fixes #14646

@hnrch02

hnrch02 commented Oct 3, 2014

Copy link
Copy Markdown
Collaborator

#14646 (comment) also mentions closing the dropdown by the up arrow.
Furthermore, when opening the dropdown by space and pressing space again selects the first item. which I don't think it should.

@hnrch02 hnrch02 added the js label Oct 3, 2014
@hnrch02 hnrch02 added this to the v3.2.1 milestone Oct 3, 2014
Comment thread js/dropdown.js Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why switch to keyCode from which? I mean, keyCode should always be defined on a keydown event but which is normalized by jQuery.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

i just wanted it to be consistent… seemed ghetto to check for keyCode, then check for which below

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Makes sense.

@fat

fat commented Oct 3, 2014

Copy link
Copy Markdown
Member Author

i disagree with closing it with up - try with the actual option input provided http://www.w3schools.com/html/tryit.asp?filename=tryhtml_select2

@fat

fat commented Oct 3, 2014

Copy link
Copy Markdown
Member Author

also, native browser space selects in that option as well, so i think space selecting when open makes sense

@hnrch02

hnrch02 commented Oct 3, 2014

Copy link
Copy Markdown
Collaborator

i disagree with closing it with up

Was just mentioning it, though the dropdowns we provide aren't really comparable to select inputs IMO.

also, native browser space selects in that option as well, so i think space selecting when open makes sense

Again not really comparable, but also it requires two space hits to select an item: The first one opens the dropdown and the second one selects the first item.

@fat

fat commented Oct 3, 2014

Copy link
Copy Markdown
Member Author

ah gotcha – i think it's fine for now. However I don't have really strong feels about it.

if you want to change it, feel free :)

going to merge this for now though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Escape key should only close Dropdown

2 participants