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(component/models): prevent scrolling of body when modal is shown #700

Merged
merged 2 commits into from
Apr 17, 2023

Conversation

multiwebinc
Copy link
Contributor

Fixes #604

@codecov
Copy link

codecov bot commented Apr 14, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.01 ⚠️

Comparison is base (6f1869b) 99.42% compared to head (935a582) 99.42%.

❗ Current head 935a582 differs from pull request most recent head f9844eb. Consider uploading reports for the commit f9844eb to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #700      +/-   ##
==========================================
- Coverage   99.42%   99.42%   -0.01%     
==========================================
  Files         130      130              
  Lines        6476     6453      -23     
  Branches      485      485              
==========================================
- Hits         6439     6416      -23     
  Misses         37       37              
Impacted Files Coverage Δ
src/lib/components/Modal/Modal.tsx 100.00% <100.00%> (ø)

... and 4 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@rluders rluders changed the title Prevent scrolling of body when modal is shown fix(component/models): prevent scrolling of body when modal is shown Apr 17, 2023
@rluders rluders merged commit ab6e96a into themesberg:main Apr 17, 2023
@multiwebinc multiwebinc deleted the patch-7 branch April 17, 2023 19:54
@rgwebcode
Copy link

Maybe I'm doing this not the right way, but this fails if there are multiple modals on a page. It's being triggered for each modal, and the overflow setting will be applied for the last modal in the queue (which most of the time is not the one being opened, so "auto" instead of "hidden" is being set last).

@multiwebinc
Copy link
Contributor Author

@rgwebcode You're right. It doesn't take into account multiple modals. I recommend opening an issue if you haven't done so already.

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.

Prevent scrolling on body when Modal is open
3 participants