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

fix: Pages can be scrolled when hovering sticky navs #22441

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

Datata1
Copy link

@Datata1 Datata1 commented Dec 15, 2024

What does it do?

This PR introduces a change to the LeftMenu component to prevent the page from scrolling when the cursor hovers over the MainNav component. The implementation uses useEffect to add and remove event listeners for the wheel event, effectively toggling the scroll behavior based on the cursor's position.

Why is it needed?

This change addresses an issue where users could inadvertently scroll the entire page when interacting with the sticky navigation bar (MainNav).

How to test it?

Go to any page and hover over the left navbar and try to scroll.

Related issue(s)/PR(s)

Fixes #22408

Copy link

vercel bot commented Dec 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
contributor-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 15, 2024 4:34pm

@strapi-cla
Copy link

strapi-cla commented Dec 15, 2024

CLA assistant check
All committers have signed the CLA.

@lucasboilly
Copy link
Contributor

Thanks for your contribution @Datata1 :)

Would it be possible to extend this behavior to the secondary nav as well? If there's too much content in it, the secondary nav is scrollable (you can find an example in the settings of Strapi) but if there's not enough (see recording) we can still scroll the whole page even if we're hovering it.

CleanShot.2024-12-16.at.12.59.51.mp4

@Datata1
Copy link
Author

Datata1 commented Dec 16, 2024 via email

@lucasboilly
Copy link
Contributor

@Datata1 that's absolutely not a problem! You can take as much time as you want of course 🙂

@lucasboilly lucasboilly self-assigned this Dec 17, 2024
@hanpaine hanpaine added source: core:admin Source is core/admin package pr: fix This PR is fixing a bug community labels Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community pr: fix This PR is fixing a bug source: core:admin Source is core/admin package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pages can be scrolled when hovering sticky navs
4 participants