mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 06:04:11 +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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
emojiPicker.addEventListener("keydown", this._keyDown);
|
||||||
|
|
||||||
const textareaWrapper = document.querySelector(
|
const textareaWrapper = document.querySelector(
|
||||||
".d-editor-textarea-wrapper"
|
".d-editor-textarea-wrapper"
|
||||||
);
|
);
|
||||||
|
@ -137,6 +139,9 @@ export default Component.extend({
|
||||||
@action
|
@action
|
||||||
onClose() {
|
onClose() {
|
||||||
document.removeEventListener("click", this.handleOutsideClick);
|
document.removeEventListener("click", this.handleOutsideClick);
|
||||||
|
document
|
||||||
|
.querySelector(".emoji-picker")
|
||||||
|
?.removeEventListener("keydown", this._keyDown);
|
||||||
this.onEmojiPickerClose && this.onEmojiPickerClose();
|
this.onEmojiPickerClose && this.onEmojiPickerClose();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -215,8 +220,8 @@ export default Component.extend({
|
||||||
section && section.scrollIntoView();
|
section && section.scrollIntoView();
|
||||||
},
|
},
|
||||||
|
|
||||||
@action
|
@bind
|
||||||
keydown(event) {
|
_keyDown(event) {
|
||||||
if (event.code === "Escape") {
|
if (event.code === "Escape") {
|
||||||
this.onClose();
|
this.onClose();
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{{#if isActive}}
|
{{#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">
|
<div class="emoji-picker-category-buttons">
|
||||||
{{#if recentEmojis.length}}
|
{{#if recentEmojis.length}}
|
||||||
<button type="button" data-section="recent" {{action "onCategorySelection" "recent"}} class="btn btn-default category-button emoji">
|
<button type="button" data-section="recent" {{action "onCategorySelection" "recent"}} class="btn btn-default category-button emoji">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user