@nutrafol/popup-helper
Advanced tools
Comparing version 0.1.4 to 0.1.5
28
index.js
@@ -140,18 +140,16 @@ /** | ||
var isTab = e.key === "Tab" || e.keyCode === 9 | ||
if (!isTab) { | ||
return | ||
} | ||
if (e.shiftKey) { | ||
/* shift + tab */ | ||
if (document.activeElement === firstFocusableEl) { | ||
lastFocusableEl.focus() | ||
e.preventDefault() | ||
if (isTab) { | ||
if (e.shiftKey) { | ||
/* shift + tab */ | ||
if (document.activeElement === firstFocusableEl) { | ||
lastFocusableEl.focus() | ||
e.preventDefault() | ||
} | ||
} else { | ||
/* tab */ | ||
if (document.activeElement === lastFocusableEl) { | ||
firstFocusableEl.focus() | ||
e.preventDefault() | ||
} | ||
} | ||
} else { | ||
/* tab */ | ||
if (document.activeElement === lastFocusableEl) { | ||
firstFocusableEl.focus() | ||
e.preventDefault() | ||
} | ||
} | ||
@@ -158,0 +156,0 @@ } |
{ | ||
"name": "@nutrafol/popup-helper", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "nutrafol popup helper", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
9904
179