mirror of
https://github.com/discourse/discourse.git
synced 2025-03-29 19:15:35 +08:00
FIX: closing the picker shouldn't propagate the pointer event (#16266)
This commit is contained in:
parent
cbaf7c949b
commit
4a39850aac
@ -153,9 +153,10 @@ export default Component.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
@action
|
@action
|
||||||
onClose() {
|
onClose(event) {
|
||||||
|
event?.stopPropagation();
|
||||||
document.removeEventListener("click", this.handleOutsideClick);
|
document.removeEventListener("click", this.handleOutsideClick);
|
||||||
this.onEmojiPickerClose && this.onEmojiPickerClose();
|
this.onEmojiPickerClose && this.onEmojiPickerClose(event);
|
||||||
},
|
},
|
||||||
|
|
||||||
diversityScales: computed("selectedDiversity", function () {
|
diversityScales: computed("selectedDiversity", function () {
|
||||||
@ -221,7 +222,7 @@ export default Component.extend({
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (this.site.isMobileDevice) {
|
if (this.site.isMobileDevice) {
|
||||||
this.onClose();
|
this.onClose(event);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -236,7 +237,7 @@ export default Component.extend({
|
|||||||
@action
|
@action
|
||||||
keydown(event) {
|
keydown(event) {
|
||||||
if (event.code === "Escape") {
|
if (event.code === "Escape") {
|
||||||
this.onClose();
|
this.onClose(event);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -334,7 +335,7 @@ export default Component.extend({
|
|||||||
handleOutsideClick(event) {
|
handleOutsideClick(event) {
|
||||||
const emojiPicker = document.querySelector(".emoji-picker");
|
const emojiPicker = document.querySelector(".emoji-picker");
|
||||||
if (emojiPicker && !emojiPicker.contains(event.target)) {
|
if (emojiPicker && !emojiPicker.contains(event.target)) {
|
||||||
this.onClose();
|
this.onClose(event);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user