Aria-practices: Accordion Example: Ctrl-PageUp and Ctrl-PageDown do not work and unused modified keys are trapped

Created on 18 Jun 2017  路  8Comments  路  Source: w3c/aria-practices

In the accordion example:

  • [x] ctrl-PageUp and ctrl-PageDown are not captured by the JavaScript so focus moves to a different browser tab.
  • [x] Modifiers are not handled correctly so unused keys are being captured. For instance, alt+left/right do not work when focus is in the accordion. Only keys that are used should be captured.

@gerardkcohen, I am hoping you can help resolve this issue.

bug example of pattern implementation

Most helpful comment

The Working Group just discussed Accordion key commands.

The full IRC log of that discussion
<AnnAbbott> TOPIC: Accordion key commands

<AnnAbbott> mck: have key that enables jump to header or next header

<AnnAbbott> mck: browsers use those keys to switch between open browser tabs

<AnnAbbott> mck: no native accordion so we have nothing to emulate

<AnnAbbott> mck: Issue 400: Accordion Example: Ctrl-PageUp and Ctrl-PageDown do not work and unused modified keys are trapped

<jamesn> q+

<jamesn> q+ to say it is interesting that the keys are not in the tab pattern but they are in the accordion pattern

<AnnAbbott> bg: one historical issue is that screen readers do not recognize those keys

<AnnAbbott> mck: accordion is not widget or composite widget

<AnnAbbott> jn: document in kbd section, not in examples

<AnnAbbott> jn: why is it in accordion pattern?

<AnnAbbott> Ann: vote to remove it

<jamesn> +1 to removing

<AnnAbbott> mck: simple approach makes it fixable in current release

<AnnAbbott> no one opposes

<jamesn> GitHub: https://github.com/w3c/aria-practices/issues/400

All 8 comments

@mcking65 I can most certainly take care of this

@mcking65 I have been working to get the ctrl-pageup/down combination to work and I am finding that it does not fire consistently across browsers. Testing against other examples that have attempted to implement this combination as well as generic keyboard event libraries and seeing the same thing. Chrome, for example, does not even fire the event for me to capture. As long as this combination has been part of the pattern, not sure it can be changed but the difficulties across browsers/ platforms may be the reason while it is rarely adopted. I did test with adding SHIFT, e.g. CTRL+SHIFT+PAGEUP/DOWN and that does fire properly. Thoughts?

@mcking65, @gerardkcohen, have you found a solution for ctrl-page up/down or do you think it's best to use the SHIFT workaround?

@DaveBagler, we've pushed this to the back burner for now. Those keys are marked optional. That said, we could at least figure out the eventual way forward.

One problem with patterns like this one is that there is no native desktop equivalent of an accordion. So, for the type of functionality we are talking about in this issue, there are no existing conventions.

Part of the rationale for ctrl-pgup/down was that it is a familiar key command for moving among tab panels, and accordions are kind of like tab panels. While it conflicts with browser tab commands, browsers have duplicate keys for that command, e.g., ctrl+tab moves focus among browser tabs.

Some implementations of accordions in the wild use ctrl+up/down arrows for this function. However, that doesn't work if focus is in a text area inside the accordion panel.

We could consider using ctrl+shift+pgup/down or possibly alt+pgup/down. Neither has the advantage that users may discover it via experimentation. They'll always drive documentation of some kind. There isn't even a good place to reveal the key assignment for this function with aria-hotkeys.

As always, the task force is open to ideas. I can add this to our meeting agenda for next week so we at least get a plan in place and edit the pattern accordingly.

Thanks for the update @mcking65. I think I'll end up needing to pick something. I'll report back if we end up with something that works well.

The Working Group just discussed Accordion key commands.

The full IRC log of that discussion
<AnnAbbott> TOPIC: Accordion key commands

<AnnAbbott> mck: have key that enables jump to header or next header

<AnnAbbott> mck: browsers use those keys to switch between open browser tabs

<AnnAbbott> mck: no native accordion so we have nothing to emulate

<AnnAbbott> mck: Issue 400: Accordion Example: Ctrl-PageUp and Ctrl-PageDown do not work and unused modified keys are trapped

<jamesn> q+

<jamesn> q+ to say it is interesting that the keys are not in the tab pattern but they are in the accordion pattern

<AnnAbbott> bg: one historical issue is that screen readers do not recognize those keys

<AnnAbbott> mck: accordion is not widget or composite widget

<AnnAbbott> jn: document in kbd section, not in examples

<AnnAbbott> jn: why is it in accordion pattern?

<AnnAbbott> Ann: vote to remove it

<jamesn> +1 to removing

<AnnAbbott> mck: simple approach makes it fixable in current release

<AnnAbbott> no one opposes

<jamesn> GitHub: https://github.com/w3c/aria-practices/issues/400

Per task force discussion, commit 2b6dcaf removes the optional commands associated with Ctrl-PageUp and Ctrl-PageDown. Of course, authors may choose to implement such functionality and use key assignments that fit well within their application.

However, this issue remains open because of modified keys being trapped unnecessarily.

Retested alt+left, alt+right, alt+d, and all work correctly when focus is inside accordion, either on headers or in the input elements.

Tested in both Firefox and Chrome.

Closing as resolved.

Was this page helpful?
0 / 5 - 0 ratings