Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
blur-accessibly
Advanced tools
Use
element.blur()
without losing thetab
position.
Firefox (v71) / Safari (v13): The native Element.blur()
resets the tab focus to the start of the document; This module places it back next to the blurred field/element.
Chrome (v79): element.blur()
works correctly there.
You can just download the standalone bundle (it might take a minute to download)
Or use npm
:
npm install blur-accessibly
// This module is only offered as a ES Module
import blurAccessibly from 'blur-accessibly';
// Instead of calling `element.blur()`
blurAccessibly(element);
For example if you want to blur a field by pressing esc:
document.querySelector('textarea').addEventListener('keydown', event => {
if (event.key === 'Escape') {
blurAccessibly(event.target);
}
});
Type: HTMLElement
The element to call .blur()
on. The tabindex
will be preserved around it (textarea
and input
, except in Safari) or after it elsewhere.
<textarea>
, in a few bytes.<textarea>
to fit its content, in a few bytes.blur-accessibly
to many elements.FAQs
Use `element.blur()` without losing the `tab` position
The npm package blur-accessibly receives a total of 4 weekly downloads. As such, blur-accessibly popularity was classified as not popular.
We found that blur-accessibly demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.