Beruflich Dokumente
Kultur Dokumente
In our opinion, there are very few cases which really need optimisation for keyboard
interaction. Always think twice and look for a standard behaviour first that may fit your
need (even if it looks very different on first sight).
Focus management
#Link to heading "Focus management"
This can be explained especially well by looking at the dialog pattern. Indeed, our guide
has such a dialog implementaion available as a fully working example, so if you are
really curious and want to learn more about this, skip ahead and read Dialog widget (or:
modal, popup, lightbox, alert).
Specifically, the first content element of the dialog should be focused, due to the
following reason: users usually make their way from top to bottom of a page, be it while
reading content or moving the keyboard focus. Placing the focus on the first content
element does not interrupt this workflow. It usually is a good practice to define the
dialog's close button to be this first element:
$("button#show-dialog").click(function() {
$("div#dialog button.close").focus();
});
<button id="show-dialog">
Show terms and conditions (dialog)
</button>
<div id="dialog">
<button class="close">Close dialog</button>