Fix #5439: Fix to prevent the background from shifting when the modal…#5459
Fix #5439: Fix to prevent the background from shifting when the modal…#5459guillermo-escire wants to merge 6 commits into
Conversation
… modal sharing window is open.
… modal sharing window is open.
|
Hi @guillermo-escire, |
|
Our test result: Works as intended. Turned on AddToAny plugin. Page is scrollable at first. After opening the AddToAny modal, the background cannot be scrolled anymore. Closing the modal makes the page scrollable again. pr_5459.mp4 |
|
Hi @kanasznagyzoltan , Thank you for testing! Glad it works as expected. |
There was a problem hiding this comment.
Thanks for the fix, @guillermo-escire. I've verified this on the item page:
-
Before: Background remained scrollable while sharing.
-
After: overflow: hidden is correctly applied to the body via the new SocialService logic.
Restoring scroll works perfectly upon closing. Tests passed on my end as well.
|
Hi @guillermo-escire, |
nathanmlf
left a comment
There was a problem hiding this comment.
Hi @guillermo-escire! Tested it on my end and, as others have attested, besides the merge conflicts, everything is working perfectly. Nice job!
References
Description
Fixes an issue where the page background remained scrollable while the AddToAny share modal was open by properly locking and restoring body scroll.
Instructions for Reviewers
This PR fixes the issue where the page background could still be scrolled when the Share modal (AddToAny) was open.
Since AddToAny does not reliably expose lifecycle callbacks for modal open/close events, a DOM-based approach was implemented using a MutationObserver to detect when the modal is present and visible.
List of changes in this PR:
.a2a_full).overflow: hidden) when the modal is visible.How to test
config.yml.Checklist
This checklist provides a reminder of what we are going to look for when reviewing your PR. You do not need to complete this checklist prior creating your PR (draft PRs are always welcome).
However, reviewers may request that you complete any actions in this list if you have not done so. If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!
mainbranch of code (unless it is a backport or is fixing an issue specific to an older branch).npm run lintnpm run check-circ-deps)package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.