Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
@polymer/iron-a11y-keys-behavior
Advanced tools
A behavior that enables keybindings for greater a11y.
##Polymer.IronA11yKeysBehavior
Polymer.IronA11yKeysBehavior
provides a normalized interface for processing
keyboard commands that pertain to WAI-ARIA best practices.
The element takes care of browser differences with respect to Keyboard events
and uses an expressive syntax to filter key presses.
Use the keyBindings
prototype property to express what combination of keys
will trigger the callback. A key binding has the format
"KEY+MODIFIER:EVENT": "callback"
("KEY": "callback"
or
"KEY:EVENT": "callback"
are valid as well). Some examples:
keyBindings: {
'space': '_onKeydown', // same as 'space:keydown'
'shift+tab': '_onKeydown',
'enter:keypress': '_onKeypress',
'esc:keyup': '_onKeyup'
}
The callback will receive with an event containing the following information in event.detail
:
_onKeydown: function(event) {
console.log(event.detail.combo); // KEY+MODIFIER, e.g. "shift+tab"
console.log(event.detail.key); // KEY only, e.g. "tab"
console.log(event.detail.event); // EVENT, e.g. "keydown"
console.log(event.detail.keyboardEvent); // the original KeyboardEvent
}
Use the keyEventTarget
attribute to set up event handlers on a specific
node.
See the demo source code for an example.
FAQs
A behavior that enables keybindings for greater a11y.
The npm package @polymer/iron-a11y-keys-behavior receives a total of 28,072 weekly downloads. As such, @polymer/iron-a11y-keys-behavior popularity was classified as popular.
We found that @polymer/iron-a11y-keys-behavior demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 11 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.