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

Focus problem when clicking on combobox dropdown button with mouse #1261

Closed
carmacleod opened this issue Nov 13, 2019 · 8 comments · Fixed by #1276
Closed

Focus problem when clicking on combobox dropdown button with mouse #1261

carmacleod opened this issue Nov 13, 2019 · 8 comments · Fixed by #1276
Assignees
Labels
bug Code defects; not for inaccurate prose Example Page Related to a page containing an example implementation of a pattern
Milestone

Comments

@carmacleod
Copy link
Contributor

carmacleod commented Nov 13, 2019

Platform: Windows/Chrome (maybe others)
(part of functional review for PR #1255)

Steps:

  1. Go to Editable Combobox With Both List and Inline Autocomplete Example
    (Note that the link to this example will change after the PR is merged)
  2. Focus the combobox, either by tabbing or with mouse
  3. Type 'A' and observe combobox dropdown list of 5 US state names that begin with 'A'
  4. Now, using mouse, click the drop-down button

The list appears and takes focus, but then it immediately loses focus and disappears because focus has been moved to the combobox text input. This looks very strange.

@carmacleod
Copy link
Contributor Author

carmacleod commented Nov 13, 2019

Same problem in other combobox examples that have the dropdown button:

@LaurenceRLewis
Copy link

Just wondering

In the table under the ‘Text’ heading with role combobox, the attribute column that includes aria-haspopup is set to “true”. Because this example pops up a listbox, should this not be aria-haspopup=“listbox”?

According to the specification;

’The value of aria-haspopup matches the role of the popup container. ‘

and

’To provide backward compatibility with ARIA 1.0 content, user agents MUST treat an aria-haspopup value of true as equivalent to a value of menu.’

https://www.w3.org/TR/wai-aria-1.1/#aria-haspopup

@carmacleod
Copy link
Contributor Author

Oooh - good catch, @LaurenceRLewis !

That bug is not only in the example writeup, I see it in the example code as well.

The spec also says:

Elements with the role combobox have an implicit aria-haspopup value of listbox.

so maybe the cleanest fix is to delete aria-haspopup from any combobox example that has a listbox popup. Thanks!

@zcorpan
Copy link
Member

zcorpan commented Nov 13, 2019

The popup is behaving pretty strangely. It seems like it sometimes gets into a bad state where clicking the button opens and immediately closes again. Also the popup closes after "mouseout", which is annoying.

@JAWS-test
Copy link

Platform: Windows/Chrome (maybe others)

In Windows: The problem also occurs with IE 11 and Firefox.

@mcking65 mcking65 added bug Code defects; not for inaccurate prose Example Page Related to a page containing an example implementation of a pattern labels Nov 14, 2019
@mcking65 mcking65 added this to the 1.2 Release 1 milestone Nov 14, 2019
@mcking65
Copy link
Contributor

@@LaurenceRLewis wrote:

In the table under the ‘Text’ heading with role combobox, the attribute column that includes aria-haspopup is set to “true”. Because this example pops up a listbox, should this not be aria-haspopup=“listbox”?

According to the specification;

’The value of aria-haspopup matches the role of the popup container. ‘

and

’To provide backward compatibility with ARIA 1.0 content, user agents MUST treat an aria-haspopup value of true as equivalent to a value of menu.’

https://www.w3.org/TR/wai-aria-1.1/#aria-haspopup

Removed unnecessary aria-haspopup declarations and supporting documentation with commit e51ad04.

@carmacleod
Copy link
Contributor Author

I retested steps 2, 3, and 4 (above) using the examples in PR #1276:

This problem will be fixed after PR #1276 is merged.

@mcking65
Copy link
Contributor

mcking65 commented Feb 7, 2020

Thank you @carmacleod, linking to #1276.

mcking65 added a commit that referenced this issue Feb 14, 2020
…raction, visual design, and more (pull #1276)

Fixes #785, #982, #983, #988, #1261, #1265, and #1268 with the following changes:
* updated JavaScript to use single prototype
* updated escape key behavior
* removed unused files
* fixed regression issues for escape key
* updated tests for single and double escape key tests
* fixed focus bug on enter and removed use of keycode property
* fixed bug in opening list and improved property names for visual focus flags
* fixed bug in opening list with alt key pressed
* fixed bug with enter key not updating aria-expanded
* fixed bugs with down arrow
* added documentation and tests for ALT Down Arrow
* fixed some styling bugs
* Use only one SVG image to show listbox state
* updated CSS for styling listbox focus
* fixed scrolling issue in listbox
* adjusted position of svg image button
* fixed onclik bug where not selecting options when autocomplete is list or none
* updated test for autocomplete, list and none
* fixed bug with onclick behavior and documented option filtering as users type
* updated documentation about filtering of options
* Typo: character -> characters
* fixed option filter bug with autocomplete=none
* improved description of when listbox opens
* use lowercase "the" in sentence
* Minor editorial revision to alt+down in textbox keyboard table
* udpated test file to check for aria-selected on option when listbox opens
* fixed aria-selected tests
* add tests for aria-selected to key down tests
* Add aria-hidden=false and focusable=false to svg in button
* Use fewer descendant combinators in selectors
* Call function instead of setting a property on elements
* Don't call setValue() when hitting backspace, to avoid moving the cursor to the end
* Remove superfluous isPrintableCharacter() call
* Remove unused variable textContent
* Declare option outside for loop. Also use null instead of false
* Set scrollTop once
* Declare index variable in the if block
* Move isPrintableCharacter to ComboboxAutocomplete.prototype
* Add information about the id attribute for all combobox examples; fixes #785

Co-authored-by: Carolyn MacLeod <Carolyn_MacLeod@ca.ibm.com>
Co-authored-by: Matt King <a11yThinker@Gmail.com>
Co-authored-by: Valerie Young <spectranaut@gmail.com>
Co-authored-by: Simon Pieters <zcorpan@gmail.com>
michael-n-cooper pushed a commit that referenced this issue Feb 14, 2020
Combobox Examples with listbox popup: Fix Escape behavior, mouse interaction, visual design, and more  (pull #1276)

Fixes #785, #982, #983, #988, #1261, #1265, and #1268 with the following changes:
* updated JavaScript to use single prototype
* updated escape key behavior
* removed unused files
* fixed regression issues for escape key
* updated tests for single and double escape key tests
* fixed focus bug on enter and removed use of keycode property
* fixed bug in opening list and improved property names for visual focus flags
* fixed bug in opening list with alt key pressed
* fixed bug with enter key not updating aria-expanded
* fixed bugs with down arrow
* added documentation and tests for ALT Down Arrow
* fixed some styling bugs
* Use only one SVG image to show listbox state
* updated CSS for styling listbox focus
* fixed scrolling issue in listbox
* adjusted position of svg image button
* fixed onclik bug where not selecting options when autocomplete is list or none
* updated test for autocomplete, list and none
* fixed bug with onclick behavior and documented option filtering as users type
* updated documentation about filtering of options
* Typo: character -> characters
* fixed option filter bug with autocomplete=none
* improved description of when listbox opens
* use lowercase "the" in sentence
* Minor editorial revision to alt+down in textbox keyboard table
* udpated test file to check for aria-selected on option when listbox opens
* fixed aria-selected tests
* add tests for aria-selected to key down tests
* Add aria-hidden=false and focusable=false to svg in button
* Use fewer descendant combinators in selectors
* Call function instead of setting a property on elements
* Don't call setValue() when hitting backspace, to avoid moving the cursor to the end
* Remove superfluous isPrintableCharacter() call
* Remove unused variable textContent
* Declare option outside for loop. Also use null instead of false
* Set scrollTop once
* Declare index variable in the if block
* Move isPrintableCharacter to ComboboxAutocomplete.prototype
* Add information about the id attribute for all combobox examples; fixes #785

Co-authored-by: Carolyn MacLeod <Carolyn_MacLeod@ca.ibm.com>
Co-authored-by: Matt King <a11yThinker@Gmail.com>
Co-authored-by: Valerie Young <spectranaut@gmail.com>
Co-authored-by: Simon Pieters <zcorpan@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Code defects; not for inaccurate prose Example Page Related to a page containing an example implementation of a pattern
Projects
None yet
5 participants