Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

wicg-focus-ring

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wicg-focus-ring - npm Package Compare versions

Comparing version 3.0.1 to 3.0.2

.eslintrc.js

22

dist/focus-ring.js

@@ -144,3 +144,8 @@ (function (global, factory) {

function onWindowFocus() {
window.removeEventListener('focus', onWindowFocus, true);
// When removing the activeElement from DOM it's possible IE11 is in state
// document.activeElement === null
if (!document.activeElement) {
return;
}
if (document.activeElement == elWithFocusRing) {

@@ -163,4 +168,13 @@ addFocusRingClass(elWithFocusRing);

window.addEventListener('focus', onWindowFocus, true);
// When removing the activeElement from DOM it's possible IE11 is in state
// document.activeElement === null
if (!document.activeElement) {
return;
}
// Set initial state back to assuming that the user is relying on the keyboard.
// And add listeners to detect if they use a pointing device instead.
hadKeyboardEvent = true;
addInitialPointerMoveListeners();
if (document.activeElement.classList.contains('focus-ring')) {

@@ -201,3 +215,5 @@ // Keep a reference to the element to which the focus-ring class is

// window blurs, even if you're tabbing out of the page. ¯\_(ツ)_/¯
if (e.target.nodeName.toLowerCase() === 'html') return;
if (e.target.nodeName.toLowerCase() === 'html') {
return;
}

@@ -204,0 +220,0 @@ hadKeyboardEvent = false;

8

package.json
{
"name": "wicg-focus-ring",
"version": "3.0.1",
"version": "3.0.2",
"description": "Polyfill for :focus-ring pseudo-selector",

@@ -15,2 +15,3 @@ "scripts": {

"lint-staged": {
"src/focus-ring.js": ["eslint"],
"*.{js,json,css}": ["prettier --write", "git add"]

@@ -33,2 +34,5 @@ },

"concurrently": "3.5.0",
"eslint": "4.11.0",
"eslint-config-prettier": "2.7.0",
"eslint-plugin-es5": "1.1.0",
"expect": "1.20.2",

@@ -43,3 +47,3 @@ "geckodriver": "1.10.0",

"prettier": "1.8.2",
"rollup": "0.51.6",
"rollup": "0.51.7",
"rollup-plugin-commonjs": "8.2.6",

@@ -46,0 +50,0 @@ "rollup-plugin-node-resolve": "3.0.0",

@@ -1,4 +0,1 @@

import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
export default {

@@ -9,4 +6,3 @@ input: 'src/focus-ring.js',

format: 'umd'
},
plugins: [resolve({ jsnext: true, main: true }), commonjs()]
}
};

@@ -138,3 +138,8 @@ /**

function onWindowFocus() {
window.removeEventListener('focus', onWindowFocus, true);
// When removing the activeElement from DOM it's possible IE11 is in state
// document.activeElement === null
if (!document.activeElement) {
return;
}
if (document.activeElement == elWithFocusRing) {

@@ -157,4 +162,13 @@ addFocusRingClass(elWithFocusRing);

window.addEventListener('focus', onWindowFocus, true);
// When removing the activeElement from DOM it's possible IE11 is in state
// document.activeElement === null
if (!document.activeElement) {
return;
}
// Set initial state back to assuming that the user is relying on the keyboard.
// And add listeners to detect if they use a pointing device instead.
hadKeyboardEvent = true;
addInitialPointerMoveListeners();
if (document.activeElement.classList.contains('focus-ring')) {

@@ -195,3 +209,5 @@ // Keep a reference to the element to which the focus-ring class is

// window blurs, even if you're tabbing out of the page. ¯\_(ツ)_/¯
if (e.target.nodeName.toLowerCase() === 'html') return;
if (e.target.nodeName.toLowerCase() === 'html') {
return;
}

@@ -198,0 +214,0 @@ hadKeyboardEvent = false;

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc