Skip to content

Commit 8bda62d

Browse files
committed
prevent back navigation on custom elements wrapping input; fix #3
1 parent 0641489 commit 8bda62d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

contentscript.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ document.onkeydown = function(e) {
1111
return;
1212
}
1313

14-
if (["INPUT", "TEXTAREA"].indexOf(document.activeElement.tagName) > -1) {
14+
// Overcomes issues with custom elements wrapping INPUT
15+
const target = event.path[0];
16+
17+
if (["INPUT", "TEXTAREA"].indexOf(target.tagName) > -1) {
1518
return;
1619
}
1720

0 commit comments

Comments
 (0)