DEV: revert linting workaround for emoji picker `keydown` action (#15424)

This commit is contained in:
Penar Musaraj 2021-12-30 12:39:21 -05:00 committed by GitHub
parent bbca25e875
commit 05eaedc810
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 8 deletions

View File

@ -89,8 +89,6 @@ export default Component.extend({
return;
}
emojiPicker.addEventListener("keydown", this._keyDown);
const textareaWrapper = document.querySelector(
".d-editor-textarea-wrapper"
);
@ -139,9 +137,6 @@ export default Component.extend({
@action
onClose() {
document.removeEventListener("click", this.handleOutsideClick);
document
.querySelector(".emoji-picker")
?.removeEventListener("keydown", this._keyDown);
this.onEmojiPickerClose && this.onEmojiPickerClose();
},
@ -220,8 +215,8 @@ export default Component.extend({
section && section.scrollIntoView();
},
@bind
_keyDown(event) {
@action
keydown(event) {
if (event.code === "Escape") {
this.onClose();
return false;

View File

@ -1,5 +1,7 @@
{{#if isActive}}
<div class="emoji-picker {{if @isActive "opened"}}">
{{!-- template-lint-disable no-invalid-interactive --}}
<div {{on "keydown" (action "keydown")}} class="emoji-picker {{if @isActive "opened"}}">
{{!-- template-lint-enable no-invalid-interactive --}}
<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">