Skip to content

Commit 140cac4

Browse files
committed
Add autocomplete popup z-index: click events now work
1 parent d3f1460 commit 140cac4

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

plugins/autocomplete.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ code-input .code-input_autocomplete_popup {
22
display: block;
33
position: absolute;
44
margin-top: 1em; /* Popup shows under the caret */
5+
z-index: 100;
56
}
67

78

plugins/autocomplete.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ codeInput.plugins.Autocomplete = class extends codeInput.Plugin {
3434

3535
let textarea = codeInput.querySelector("textarea");
3636
textarea.addEventListener("keyup", this.updatePopup.bind(this, codeInput, false)); // Override this+args in bind - not just scrolling
37-
document.addEventListener("click", this.updatePopup.bind(this, codeInput, false)); // Override this+args in bind - not just scrolling
37+
textarea.addEventListener("click", this.updatePopup.bind(this, codeInput, false)); // Override this+args in bind - not just scrolling
3838
textarea.addEventListener("scroll", this.updatePopup.bind(this, codeInput, true)); // Override this+args in bind - just scrolling
3939
}
4040
/**

0 commit comments

Comments
 (0)