Aria-pressed is one of the states and properties of ARIA which is generally used for toggle buttons to inform the state of the toggle button. It indicates the state of the toggle buttons whether the button is pressed or not. Aria-pressed should only be used for toggle buttons. It should not be used for form submit buttons or buttons which opens a modal window.
Aria-pressed has three states: True, False, Mixed.
Attribute
|
Description
|
aria-pressed=”true”
|
The button is a toggle button which is pressed
|
aria-pressed=”false”
|
The button is a toggle button which is not pressed
|
aria-pressed=”mixed”
|
Mixed value for tri-state toggle button
|
For a toggle button which is not pressed, developers should provide aria-pressed=”false” by default. Once user clicks/activates the button with mouse or keyboard, then developer should change the value to TRUE (aria-pressed=”true”).
Note: aria-pressed should be used only for toggle buttons. It should not be used at all for normal buttons which do not have toggle functionality.
Sample Code
Toggle button not pressed : <input type=”submit” value=”Bold” aria-pressed=”false” />
Toggle button pressed : <input type=”submit” value=”Bold” aria-pressed=”true” />
Not a toggle button : <input type=”submit” value=”Bold” />
Screen Reader Behavior:
Screen Reader + Browser
|
Aria-pressed state
|
SR behavior
|
JAWS 17 + IE 11
|
True
|
Bold Toggle button pressed
|
JAWS 17 + IE 11
|
False
|
Bold Toggle button
|
NVDA 2015 + FF 47
|
True
|
Bold Toggle button pressed
|
NVDA 2015 + FF 47
|
False
|
Bold Toggle button
|
Voiceover iOS9 + Safari
|
True
|
Bold Toggle button pressed Double tap to toggle setting
|
Voiceover iOS9 + Safari
|
False
|
Bold Toggle button not pressed Double tap to toggle setting
|
Talkback V6.0 + Chrome
|
True
|
Bold Toggle button ticked double tap to toggle
|
Talkback V6.0 + Chrome
|
False
|
Bold toggle button not ticked double tap to toggle
|
No comments:
Post a Comment