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

Spinner: Drop dependency on jQuery Mousewheel #2338

Merged
merged 1 commit into from
Mar 18, 2025
Merged

Conversation

mgol
Copy link
Member

@mgol mgol commented Mar 14, 2025

  1. Listen to the native wheel event without depending on any wrapper plugins.
  2. Keep listening to the mousewheel event for compatibility with projects using the jQuery Mousewheel plugin but route it to the wheel handler.

1. Listen to the native `wheel` event without depending on any wrapper plugins.
2. Keep listening to the `mousewheel` event for compatibility with projects
   using the jQuery Mousewheel plugin but route it to the `wheel` handler.
Copy link
Member

@fnagel fnagel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 by reading

@mgol mgol merged commit 6843ced into jquery:main Mar 18, 2025
11 checks passed
@mgol mgol deleted the mousewheel branch March 18, 2025 10:45
@mgol mgol removed the Needs review label Mar 18, 2025
mgol added a commit to mgol/jquery-ui that referenced this pull request Mar 19, 2025
As of jquerygh-2338, if one has loaded the jQuery MouseWheel plugin, the `mousewheel`
handler would fire the `wheel` one, but the `wheel` one would also run in
response to the native `wheel` event, resulting in double the distance handled
by the spinner. To prevent the issue, only fire the `wheel` handler from inside
the `mousewheel` on if the event was triggered by jQuery - jQuery will not care
that the underlying event is `wheel` and will only fire handlers for
`mousewheel`.

Also, add an iframe test using jQuery MouseWheel to not affect all the other
tests.

Ref jquerygh-2338
mgol added a commit that referenced this pull request Mar 20, 2025
As of gh-2338, if one has loaded the jQuery MouseWheel plugin, the `mousewheel`
handler would fire the `wheel` one, but the `wheel` one would also run in
response to the native `wheel` event, resulting in double the distance handled
by the spinner. To prevent the issue, only fire the `wheel` handler from inside
the `mousewheel` on if the event was triggered by jQuery - jQuery will not care
that the underlying event is `wheel` and will only fire handlers for
`mousewheel`.

Also, add an iframe test using jQuery MouseWheel to not affect all the other
tests.

Plus, migrate from `QUnit.reset` to `QUnit.done` (see qunitjs/qunit#354).

Closes gh-2342
Ref gh-2338
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants