mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 01:42:04 +08:00
DEV: Fix linting issue with emoji keydown
event (#15352)
This commit is contained in:
parent
4ee5d52ac9
commit
62d1114bad
|
@ -89,6 +89,8 @@ export default Component.extend({
|
|||
return;
|
||||
}
|
||||
|
||||
emojiPicker.addEventListener("keydown", this._keyDown);
|
||||
|
||||
const textareaWrapper = document.querySelector(
|
||||
".d-editor-textarea-wrapper"
|
||||
);
|
||||
|
@ -137,6 +139,9 @@ export default Component.extend({
|
|||
@action
|
||||
onClose() {
|
||||
document.removeEventListener("click", this.handleOutsideClick);
|
||||
document
|
||||
.querySelector(".emoji-picker")
|
||||
?.removeEventListener("keydown", this._keyDown);
|
||||
this.onEmojiPickerClose && this.onEmojiPickerClose();
|
||||
},
|
||||
|
||||
|
@ -215,8 +220,8 @@ export default Component.extend({
|
|||
section && section.scrollIntoView();
|
||||
},
|
||||
|
||||
@action
|
||||
keydown(event) {
|
||||
@bind
|
||||
_keyDown(event) {
|
||||
if (event.code === "Escape") {
|
||||
this.onClose();
|
||||
return false;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{{#if isActive}}
|
||||
<div {{on "keydown" (action "keydown")}} class="emoji-picker {{if @isActive "opened"}}">
|
||||
<div class="emoji-picker {{if @isActive "opened"}}">
|
||||
<div class="emoji-picker-category-buttons">
|
||||
{{#if recentEmojis.length}}
|
||||
<button type="button" data-section="recent" {{action "onCategorySelection" "recent"}} class="btn btn-default category-button emoji">
|
||||
|
|
Loading…
Reference in New Issue
Block a user