Pass a list of keyboard events to match.
onKeyDown [ enter TheyHitEnterDoSomething, left DoSomeOtherThing ]Pass a list of keyboard events to match.
onKeyDownPreventDefault [ space TheyHitEnterDoSomethingButDontScrollThePage ]Pass a list of keyboard events to match.
onKeyUp [ enter TheyHitEnterDoSomething, left DoSomeOtherThing ]Pass a list of keyboard events to match.
onKeyUpPreventDefault [ space TheyHitEnterDoSomethingButDontScrollThePage ]Note: the API here is different than in previous versions of this library because of https://github.com/elm/json/issues/15. A future version of this library may return to using generic decoders.
Use with onKeyDown to succeed when user hits the tab key.
onKeyDown [ tab Tab ]Use with onKeyDown to succeed when user hits the tab key while hitting shift.
onKeyDown [ tabBack GoBack ]Use with onKeyDown to succeed when user hits the up arrow key without the shift key.
onKeyDown [ up Up ]Use with onKeyDown to succeed when user hits the right arrow key without the shift key.
onKeyDown [ right Right ]Use with onKeyDown to succeed when user hits the down arrow key without the shift key.
onKeyDown [ down Down ]Use with onKeyDown to succeed when user hits the left arrow key without the shift key.
onKeyDown [ left Left ]Succeed when user hits the shift key by itself.
onKeyDown [ shift Shift ]Succeed when user hits the up arrow key with the shift key.
onKeyDown [ shiftUp Up ]Succeed when user hits the right arrow key with the shift key.
onKeyDown [ shiftRight Right ]Succeed when user hits the down arrow key with the shift key.
onKeyDown [ shiftDown Down ]Succeed when user hits the left arrow key with the shift key.
onKeyDown [ shiftLeft Left ]Use with onKeyDown to succeed when user hits the Enter key.
onKeyDown [ enter TheyHitEnterDoSomething ]Use with onKeyDown to succeed when user hits the spacebar.
onKeyDown [ space SpaceBar ]Use with onKeyDown to succeed when user hits esc.
onKeyDown [ escape CloseModal ]
Add or remove an element from the normal flow of tabbable/focusable elements.
tabbable Truewill set the tabindex to 0, andtabbable Falsewill set the tabindex to -1.You may use
Html.Styled.Attributes.tabindexif you need to control the tab order more explicitly, but you may want to restructure your HTML to match how you want users to interact with it instead. If you're considering changing tabindex or restructuring your HTML, read Understanding Success Criterion 1.3.2: Meaningful Sequence.