-
Notifications
You must be signed in to change notification settings - Fork 370
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 with grid popup: Make escape key behavior consistent with pattern #1334
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.
+1 for Editorial review.
I have updated the escape key behavior and escape key regression tests to match the pattern. |
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.
When visual focus is in the grid, pressing escape does not hide the grid and change the combobox state to collapsed. It only moves visual focus back to the input. It is supposed to do both. Example:
- Focus combobox
- Type 'A'
- Press down arrow to move visual focus into the grid.
- Press escape.
Expected:
- Visual focus moves back to input.
- Grid is closed.
Actual: focus moves back to input.
This indicates the tests are also not testing correctly, otherwise the test for escape in the grid would fail.
Update the corresponding test to no longer expect a failure. Fixes #860.
I've fixed the logic so that escape always hides the popup if the popup is visible, regardless of focus. We were testing this case correctly. It's just that the test was marked as expected to fail, since this was a known issue: #860 I've changed the test so it instead expects to pass, and it does. |
@spectranaut can you review my changes? |
Looks like we're missing some tests. But that was the case before this PR, too, so I've filed an issue to track this: #1349 |
@@ -94,12 +94,16 @@ aria.GridCombobox.prototype.handleInputKeyDown = function (evt) { | |||
); | |||
} | |||
else { | |||
if (!this.shown) { | |||
setTimeout((function () { | |||
// On Firefox, input does not get cleared here unless wrapped in |
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.
Do we know why this happens? Is it a bug in Firefox?
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.
I think this is an issue of using keydown, instead of the keyup event. I was only asked to fix the ESC behavior, so I didn't think it would be good to make more changes than requested.
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.
Thank you @jongund, that's good call. let's address that as a separate issue if there is a better way to resolve it than what is currently implemented.
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.
code review and test review done.
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.
Functionally now working as documented.
OK, now just waiting on a review by @spectranaut of the test changes made by @zcorpan. I will merge if @spectranaut approves. |
Should down arrow (and/or alt+down arrow) open the grid? (It currently doesn't, but I think it should). |
@carmacleod commented:
That is issue #1266. |
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.
+1 again, for the latest.
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]>
…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]>
Fix issue #1066 for the grid combobox.
Preview Link
View the combobox with grid popup in compare branch of this PR
Review checklist