Skip to content

Commit ef83b9b

Browse files
authored
Hotkeys: do not trigger them on textarea HTML elements (#206)
Closes #205
1 parent 86ab371 commit ef83b9b

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

dist/readthedocs-addons.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/readthedocs-addons.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/hotkeys.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ export class HotKeysElement extends LitElement {
5757
this.docDiffHotKeyEnabled &&
5858
keyboardEventToString(e) ===
5959
this.config.addons.hotkeys.doc_diff.trigger &&
60-
document.activeElement.tagName !== "INPUT"
60+
document.activeElement.tagName !== "INPUT" &&
61+
document.activeElement.tagName !== "TEXTAREA" &&
62+
document.activeElement.tagName !== "READTHEDOCS-SEARCH"
6163
) {
6264
if (this.docDiffShowed) {
6365
event = new CustomEvent(EVENT_READTHEDOCS_DOCDIFF_HIDE);
@@ -73,6 +75,7 @@ export class HotKeysElement extends LitElement {
7375
this.searchHotKeyEnabled &&
7476
keyboardEventToString(e) === this.config.addons.hotkeys.search.trigger &&
7577
document.activeElement.tagName !== "INPUT" &&
78+
document.activeElement.tagName !== "TEXTAREA" &&
7679
document.activeElement.tagName !== "READTHEDOCS-SEARCH"
7780
) {
7881
if (this.searchShowed) {

0 commit comments

Comments
 (0)