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

Unexpected scrolling when scrolling container is focused #629

Closed
luin opened this issue Apr 22, 2024 · 3 comments
Closed

Unexpected scrolling when scrolling container is focused #629

luin opened this issue Apr 22, 2024 · 3 comments

Comments

@luin
Copy link

luin commented Apr 22, 2024

Describe the bug

If I have a element that is:

  1. Out of the viewport
  2. Focused

The page would scroll unexpectedly if I make the element an instance of OverlayScrollbars.

To Reproduce

  1. Go to https://overlayscrollers-abortive-pocket.surge.sh/ (Inspect the source code for how it's implemented)
  2. Wait for 2 seconds

Expected behavior

The page should not be scrolled. The editor is focused with preventScroll: true. It's unexpected that creating a OverlayScrollbars would scroll the page.

Environment

  • Used Operating System(s): macOS
  • Used Browser(s) (with version): Chrome 123

Additional context

I believe to fix the issue, we should pass preventScroll: true in focusElm because we only want to focus instead of scrolling.

@KingSora
Copy link
Owner

Good day @luin :)

Nice catch! I've published v2.7.3 which uses { preventScroll: true } when focusing the viewport.

@luin
Copy link
Author

luin commented Apr 23, 2024

@KingSora Thanks a lot! That's the fastest response and fix I've ever experienced on GitHub in the past 10 years 😄

@KingSora
Copy link
Owner

KingSora commented Apr 23, 2024

@luin Since I'm often slowed down by these processes as well, I'm trying to lead by example in my own repositories.. Its not always possible but whenever it is I'm trying

Glad I could help :)

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

No branches or pull requests

2 participants