Skip to content

Conversation

@Xorcist137
Copy link

Description

This PR adds support for middle mouse button scrolling (auto-scrolling) that matches native browser behavior:

Users can click the middle mouse button to enter auto-scroll mode
Moving the mouse controls scroll direction and speed
Any mouse button click or ESC key exits auto-scroll mode
Cursor changes to 'all-scroll' during auto-scrolling to indicate the mode
Simple distance-based scrolling with a small dead zone for precision

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Added events/middle-button.ts with the implementation
Added export in events/index.ts
Added enableMiddleMouseScroll option (default: true) in options.ts
Updated interfaces/scrollbar.ts with the new option type

@sadeghbarati
Copy link
Collaborator

Hi @Xorcist137 Thanks for the PR

Could you please record a video of these changes? 🙏

@Xorcist137
Copy link
Author

brave_NWcxgieh7b.mp4

Hi @sadeghbarati , Thanks for taking a look.
Here's a short video showcasing the functionality.
All it does is replicate the native experience of middle mouse scrolling.
Please let me know if you have any changes you would like to see. I'm interested in contributing however I can.

👌

@sadeghbarati sadeghbarati requested a review from idiotWu March 3, 2025 00:50
@idiotWu
Copy link
Owner

idiotWu commented Mar 10, 2025

Thank you so much for this PR! 🤗

The code looks good, but I may need a physical mouse to test the functionality later this week.

P.S. I used to think this could be implemented through a plugin XD

@jpike88
Copy link

jpike88 commented Apr 28, 2025

@idiotWu could you please give a moment of your attention to this library, also seeing #574?

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.

4 participants