Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register wheel event as passive : false #2784

Merged
merged 1 commit into from
Dec 16, 2020
Merged

Register wheel event as passive : false #2784

merged 1 commit into from
Dec 16, 2020

Conversation

misonln41
Copy link
Contributor

@misonln41 misonln41 commented Dec 16, 2020

Aim

  • Make Tree Style Tab Mouse Wheel works properly.
  • Tree Style Tab Mouse Wheel is an TST extend addon that enables users to switch active tab by scrolling mouse wheel on TST Sidebar, but now, this addon cannot handle scroll.
  • This TST extend addon calls Tree Style Tab API to handle scroll on sidebar, so this problem may not be fixed in extend addon side.

Changes added

  • Set passive : false in wheel event listener.
  • This change makes event.preventDefault(); in onWheel event runs correctly.

Risk

Environments

  • Firefox 84.0
  • Latest version of Tree Style Tab / Tree Style Tab Mouse Wheel
  • KDE Plasma
  • Arch Linux

To make 'Tree Style Tab Mouse Wheel', a TST extend addon, works properly, specify `passive : false` on wheel event registerer.
This change makes `event.preventDefault();` in `onWheel` event runs correctly, but may cause some degradation of rendering performance.
ref: https://developer.mozilla.org/ja/docs/Web/API/EventTarget/addEventListener#Improving_scrolling_performance_with_passive_listeners
@misonln41
Copy link
Contributor Author

misonln41 commented Dec 16, 2020

This is the probrem happens in current TST and TST Mouse Wheel.

When I scroll mouse wheel, not only the tab changes, but also scrolls. Seems to be failing to handle scroll event.

Peek 2020-12-16 20-11

@misonln41 misonln41 changed the title Register wheel event as passive : false Register wheel handle event as passive : false Dec 16, 2020
@misonln41 misonln41 changed the title Register wheel handle event as passive : false Register wheel event as passive : false Dec 16, 2020
@piroor piroor merged commit 933e872 into piroor:trunk Dec 16, 2020
@piroor
Copy link
Owner

piroor commented Dec 16, 2020

Thanks a lot! The default "passive" option value looked to be changed to "true" on Firefox 84.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants