Skip to content
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

Combobox: Escape key should not clear current input #1066

Closed
4 of 5 tasks
eldargab opened this issue Jul 3, 2019 · 4 comments · Fixed by #1334
Closed
4 of 5 tasks

Combobox: Escape key should not clear current input #1066

eldargab opened this issue Jul 3, 2019 · 4 comments · Fixed by #1334
Assignees
Labels
Feedback Issue raised by or for collecting input from people outside APG task force Pattern Page Related to a page documenting a Pattern question Issue asking a question
Milestone

Comments

@eldargab
Copy link

eldargab commented Jul 3, 2019

Currently ARIA 1.1 Combobox example says about ESC key that it:

  • Clears the textbox
  • If the listbox is displayed, closes it.

To my feeling textbox clearing contradicts almost everything users are used to and expect.

  1. Escape key usually means "Abort what you are currently doing". From that point of view clearing is definitely an unwanted side effect.

  2. Native browser select does not clear selection on escape key.

  3. Every UI library I am aware of, which implements combobox pattern, does not clear textbox as well. Ant design, react-select, select2 to name a few and those are very popular.

to-do list added by Matt

This will be fixed in APG 1.2 with the following:

  • Fixed in pattern with commit 315a4dd
  • Fixed in combobox-autocomplete-both.html with commit 85085b2
  • Fixed in combobox-autocomplete-list.html with commit 85085b2
  • Fixed in combobox-autocomplete-none.html with commit 85085b2
  • Fix in grid-combo.html
@smhigley
Copy link
Contributor

I agree, I think this might also get in the way of 1.4.13/Content on hover or focus, since it's currently not possible to enter a value in the input without keeping the menu open.

@mcking65 mcking65 added Feedback Issue raised by or for collecting input from people outside APG task force Pattern Page Related to a page documenting a Pattern question Issue asking a question labels Jul 19, 2019
@mcking65 mcking65 added this to the 1.2 CR milestone Jul 19, 2019
@css-meeting-bot
Copy link
Member

The ARIA Authoring Practices (APG) Task Force just discussed Combobox ESC key clear current selection.

The full IRC log of that discussion <MarkMccarthy> TOPIC: Combobox ESC key clear current selection
<MarkMccarthy> mck: we talked about this once before, but didn't get it minuted or in the issue
<jemma> https://github.com//issues/1066
<MarkMccarthy> github: https://github.com//issues/1066
<MarkMccarthy> mck: the last time we talked about this, it seemed like there was genereal consensus that, by default, ESC should -not- clear content. that's what I recall
<MarkMccarthy> mck: just wanted to make sure I'm remembering right
<MarkMccarthy> mck: Evan Y did note that it clears it in Finder on Mac, but someone else mentioned it clears -focus- on the Mac search. I confirmed this
<MarkMccarthy> jemma: is the Search field a combobox?
<MarkMccarthy> mck: I'm pretty sure
<MarkMccarthy> mck: In Finder, it doesn't actually say "combobox"
<MarkMccarthy> mck: it says "search text field". maybe it just -looks- like a combobox
<MarkMccarthy> mck: hitting ESC closes the popup and my text is still there, if I hit ESC again, then focus goes back to list view. I'd expect text to be gone in that case
<MarkMccarthy> mck: so maybe it's not a combobox
<MarkMccarthy> jemma: right
<MarkMccarthy> mck: So examples with Comboboxes?
<jemma> mark: when I tested it with window, first esc collapse the text but does not clear the text
<MarkMccarthy> MarkMccarthy: Focus doesn't leave the file explorer combobox unless ESC is pressed twice
<MarkMccarthy> mck: let's not model off of OS examples
<MarkMccarthy> group: [laughter]
<MarkMccarthy> mck: another sort of native one is in browsers' address bars. hitting ESC here collapses it, second press clears it, whaddya know
<MarkMccarthy> mck: That was with Firefox
<MarkMccarthy> MarkMccarthy: I see this behavior in Chrome and ChromeEdge too
<MarkMccarthy> jemma: so why does this matter?
<MarkMccarthy> mck: because we got some feedback this -shouldn't- happen. but it seems like this happens with the -second- press
<MarkMccarthy> mck: so maybe it's an optional behavior. maybe we should modify the pattern so if the listbox is collapsed and the textbox is not empty, pressing esc optionally clears it?
<MarkMccarthy> jemma: an option is fine, but we might not want to go deeper
<MarkMccarthy> jemma: Other opinions?
<MarkMccarthy> mck: maybe I'll propose wording back to the OP that it's optional to clear IF the popup is collapsed
<MarkMccarthy> mck: examples would be address bars in chrome and firefox
<MarkMccarthy> jemma: okay, i'll assign to you Matt

mcking65 added a commit that referenced this issue Aug 14, 2019
For issue #1066, revises description of escape behavior.
Escape may optionally clear the text box,
but only if the popup is hidden before escape is pressed.
Previously, the pattern implied both could happen with a single press of escape, which is inconsistent with any known implementations.
mcking65 added a commit that referenced this issue Aug 31, 2019
For issue #1066, revises description of escape behavior.
Escape may optionally clear the text box,
but only if the popup is hidden before escape is pressed.
Previously, the pattern implied both could happen with a single press of escape, which is inconsistent with any known implementations.
michael-n-cooper pushed a commit that referenced this issue Aug 31, 2019
Combobox Pattern: Revise Escape behavior (pull #1129)

For issue #1066, revises description of escape behavior.
Escape may optionally clear the text box,
but only if the popup is hidden before escape is pressed.
Previously, the pattern implied both could happen with a single press of escape, which is inconsistent with any known implementations.
@mcking65 mcking65 changed the title Combobox: Why escape key should clear current selection Combobox: Escape key should not clear current input Nov 14, 2019
@mcking65
Copy link
Contributor

Commit 315a4dd fixed this in the pattern but not in the examples.

@jongund
Copy link
Contributor

jongund commented Nov 22, 2019

@mcking65 I was looking at the JQuery combobox and the Escape key has the following behavior:

  1. If the listbox is open it closes the listbox
  2. If the listbox is closed is clears the textbook

Is this what we want for our comboboxes?

mcking65 added a commit that referenced this issue Mar 17, 2020
…ttern (pull #1334)

Fixes #860 and #1066:
* Revise Escape key documentation to reflect expected behavior
* updated escape key behavior to match combobox pattern
* Make escape hide the popup if it's shown, regardless of where focus is
* Update the corresponding test to no longer expect a failure (fixes #860).
* Remove comment about failing test

Co-authored-by: Jon <[email protected]>
Co-authored-by: Simon Pieters <[email protected]>
michael-n-cooper pushed a commit that referenced this issue Mar 17, 2020
Combobox with grid popup: Make escape key behavior consistent with pattern (pull #1334)

Fixes #860 and #1066:
* Revise Escape key documentation to reflect expected behavior
* updated escape key behavior to match combobox pattern
* Make escape hide the popup if it's shown, regardless of where focus is
* Update the corresponding test to no longer expect a failure (fixes #860).
* Remove comment about failing test

Co-authored-by: Jon <[email protected]>
Co-authored-by: Simon Pieters <[email protected]>
carmacleod pushed a commit to carmacleod/aria-practices that referenced this issue Mar 31, 2020
…ttern (pull w3c#1334)

Fixes w3c#860 and w3c#1066:
* Revise Escape key documentation to reflect expected behavior
* updated escape key behavior to match combobox pattern
* Make escape hide the popup if it's shown, regardless of where focus is
* Update the corresponding test to no longer expect a failure (fixes w3c#860).
* Remove comment about failing test

Co-authored-by: Jon <[email protected]>
Co-authored-by: Simon Pieters <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feedback Issue raised by or for collecting input from people outside APG task force Pattern Page Related to a page documenting a Pattern question Issue asking a question
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants