Skip to content

Instantly share code, notes, and snippets.

@rodneyrehm
Created October 14, 2014 00:10
Show Gist options
  • Save rodneyrehm/6f61a1340a0e27d37859 to your computer and use it in GitHub Desktop.
Save rodneyrehm/6f61a1340a0e27d37859 to your computer and use it in GitHub Desktop.
Some Questions regarding WAI ARIA

Question Regarding WAI ARIA

The Enter key should serve as the default submit action.

  • JS-free only possible through <form> and <button type="submit">?

It is recommended that a dialog also be cancelled by pressing the Escape key with focus on any item.

  • is this even possible without JavaScript?

Tab Focus must be held within the dialog until it is cancelled or submitted.

  • great! how is this done properly?
  • JS-free option?
  • Is listening for TAB and SHIFT TAB sufficient?
  • DOM-method / CSS selector for "tabbable" or "focussable" element?

If the current focus item has Escape key behavior, the press of the Escape will be handled by the current item and the user may have to press Escape an additional time to close the dialog.

  • great, any sane way to manage that stacking?
  • possibly JS-free?

Even if the user clicks outside of the dialog on the application which invoked the dialog, focus remains in the dialog.

  • So Clicking outside of the dialog does not change focus at all?
  • Canceling the dialog by way of outside-click is forbidden?

When the dialog is closed or cancelled focus should return to the element in the application which had focus before the dialog is invoked.

  • great! any sane way to manage that "history"?

Determining the first focusable item must take into account elements which receive focus by default (form fields and links) as well as items which may have a tabindex attribute with a positive value.

  • wasn't the value of tabindex supposed to determine tabbing priority (or order)?
  • what about tabindex="0"

Authors should ensure that Enter activates only the widget they intend.

  • again the question for a same way of managing this, possibly without too much JavaScript in play?
@rodneyrehm
Copy link
Author

it's a web application - JavaScript is mandatory. I just don't want to implement - possibly buggy/half-baked/broken stuff if I don't have to.

@ginader
Copy link

ginader commented Oct 14, 2014

Here's also a jsfiddle with Dennis' example code from his csun talk mentioned above: http://jsfiddle.net/weboverhauls/GPd5u/7/
Do you have anything to add @weboverhauls ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment