You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
3.3.0
Accessibility attributes as parameters: role, ariaLabel (aria-label), aria (any other aria-*: a key with
or without the aria- prefix, {'hidden': true}) and tabIndex (tabindex).
On the element helpers ($tag, $div, $divInline, $span, $button, $label, $a, $img, $p, $b, $h, $ul, $ol, $li, $form, $nav, $header, $footer, $hr, $input, $checkbox, $radiobutton, $select, $option, $textarea, $table, $thead, $caption, $tbody, $tfoot, $tr, $th, $td), the DOMElement factory and the element classes (DIVElement, INPUTElement, CHECKBOXElement, SELECTElement, OPTIONElement, TEXTAREAElement, TABLEElement and its parts).
New DOMElement.setAccessibility: sets them on an element already built (a null parameter keeps the
attribute; a nullaria value removes it). Chainable. On a generated element, the real one is updated too
(e.g. toggling aria-expanded on a click).
An aria key in any form: hidden, aria-hidden, ariaHidden, aria_hidden (an empty one throws an ArgumentError). New DOMElement.ariaAttributeName.
An aria value is a string: a bool"true"/"false" (an aria-* attribute isn't a boolean attribute,
whose presence alone means true), an Iterable space-joined (an ID list: aria-describedby…), an Enum its name. New DOMElement.ariaAttributeValue.
ariaLabel wins over an arialabel entry; the parameters win over the same attributes in attributes.
Element construction (parsing, copy()) is unchanged when none of them is given.
README: an Accessibility section; the navbar-toggler example uses ariaLabel and aria.
Tests: test/dom_builder_accessibility_test.dart (VM) and test/dom_builder_web_accessibility_test.dart (real
DOM).