PERF: do not cancel debounce and prevents popper on scroll (#19280)

This commit also replaces deprecated `mousewheel` by `wheel` event listener
This commit is contained in:
Joffrey JAFFEUX 2022-12-01 14:33:46 +01:00 committed by GitHub
parent 0ce38bd7bc
commit 630bde1ba2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View File

@ -99,7 +99,7 @@ export default Component.extend({
passive: true,
});
window.addEventListener("resize", this.onResizeHandler);
window.addEventListener("mousewheel", this.onScrollHandler, {
window.addEventListener("wheel", this.onScrollHandler, {
passive: true,
});
@ -124,7 +124,7 @@ export default Component.extend({
?.removeEventListener("scroll", this.onScrollHandler);
window.removeEventListener("resize", this.onResizeHandler);
window.removeEventListener("mousewheel", this.onScrollHandler);
window.removeEventListener("wheel", this.onScrollHandler);
this.appEvents.off(
"chat-live-pane:highlight-message",
@ -1320,8 +1320,6 @@ export default Component.extend({
@action
onHoverMessage(message, options = {}, event) {
cancel(this._onHoverMessageDebouncedHandler);
if (this.site.mobileView && options.desktopOnly) {
return;
}

View File

@ -31,6 +31,12 @@ export default Component.extend({
placement: "right-start",
modifiers: [
{ name: "hide", enabled: true },
{
name: "eventListeners",
options: {
scroll: false,
},
},
{
name: "offset",
options: {