这是indexloc提供的服务,不要输入任何密码
Skip to content

aria-keyshortcuts: Do multiple shortcuts define a set of alternatives, or a single sequence? #2578

@SyntaxColoring

Description

@SyntaxColoring

Describe your concern

If I write:

aria-keyshortcuts="ctrl+a ctrl+b"

Does that mean that, to activate the element, the user can press either Ctrl+A or Ctrl+B? Or does it mean that they must press Ctrl+A and then, in quick succession, press Ctrl+B?

I would think it's the former, but the MDN text (permalink) has me second-guessing that. Emphasis mine:

Modifier keys must be listed first in each key combination. Possible key combinations include Control+P or Shift+Space and Q. If the full shortcut requires all three of these combinations in order, it would be written as aria-keyshortcuts="Control+P Shift+Space Q".

I wasn't able to find an underlying source for that statement.

I guess the specification could be construed either way:

The value of the aria-keyshortcuts attribute is a space-separated list of keyboard shortcuts that can be pressed to activate a command or textbox widget. The keys defined in the shortcuts represent the physical keys pressed and not the actual characters generated. Each keyboard shortcut consists of one or more tokens delimited by the plus sign ("+") representing zero or more modifier keys and exactly one non-modifier key that must be pressed simultaneously to activate the given shortcut.

Link to the version of the specification or documentation you were looking at at.

Link to documentation: https://www.w3.org/TR/wai-aria-1.3/#aria-keyshortcuts

Does the issue exists in the editors draft (the editors draft is the most recent draft of the specification)? Yes

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions