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 body padding #475

Merged
merged 5 commits into from
Oct 2, 2023
Merged

Fix body padding #475

merged 5 commits into from
Oct 2, 2023

Conversation

lofcz
Copy link
Contributor

@lofcz lofcz commented Nov 21, 2022

After a modal is opened, the content shifts if at least one scrollbar is present. This PR fixes the most common case with a vertical scrollbar and LTR flow.

Bootstrap reference: https://github.com/twbs/bootstrap/blob/f2e15458da24a089356e3de42df8297f6140059e/js/src/modal.js#L295-L308

Before:
notice the "About" text shifting

2022-11-21.19-53-04.mp4

After:
* shift begone *

2022-11-21.20-13-10.mp4

This PR also changes the after-close cleanup logic to respect whatever values were there before we touched them. Old behavior would break pages that prevent overflow on body at all.

Resolves #489

@chrissainty chrissainty added the Bug Something isn't working label Oct 2, 2023
@chrissainty chrissainty merged commit 671cd33 into Blazored:main Oct 2, 2023
2 checks passed
@lofcz
Copy link
Contributor Author

lofcz commented Oct 2, 2023

@chrissainty just in case - I have a full fork running, probably not too far to be backported upstream. Feel free to check the changes, I can open PRs if there is interest. Branch: https://github.com/lofcz/Modal/tree/master2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Modal popup causes horizontal shift when vertical scroll bar exists
2 participants