File tree 2 files changed +10
-6
lines changed
2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -18,9 +18,11 @@ $(document).on("ready page:load turbolinks:load", function () {
18
18
$ ( window ) . on ( "keydown" , ( evt ) => {
19
19
// <input>, <textarea>, or the mailer input field
20
20
if (
21
- $ ( "input" ) . is ( ":focus" ) ||
22
- $ ( "textarea" ) . is ( ":focus" ) ||
23
- document . getElementById ( "editor" ) ?. contains ( document . activeElement )
21
+ document . activeElement &&
22
+ ( [ "input" , "textarea" ] . includes (
23
+ document . activeElement . tagName . toLowerCase ( ) ,
24
+ ) ||
25
+ document . activeElement . isContentEditable )
24
26
) {
25
27
// Cancel if any inputs are selected
26
28
return ;
Original file line number Diff line number Diff line change @@ -15,9 +15,11 @@ $(document).on("ready page:load turbolinks:load", function () {
15
15
$ ( window ) . on ( "keydown" , ( evt ) => {
16
16
// <input>, <textarea>, or the mailer input field
17
17
if (
18
- $ ( "input" ) . is ( ":focus" ) ||
19
- $ ( "textarea" ) . is ( ":focus" ) ||
20
- document . getElementById ( "editor" ) ?. contains ( document . activeElement )
18
+ document . activeElement &&
19
+ ( [ "input" , "textarea" ] . includes (
20
+ document . activeElement . tagName . toLowerCase ( ) ,
21
+ ) ||
22
+ document . activeElement . isContentEditable )
21
23
) {
22
24
// Cancel if any inputs are selected
23
25
return ;
You can’t perform that action at this time.
0 commit comments