-
Notifications
You must be signed in to change notification settings - Fork 2
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
[SAGE-518] Modal - remove ability to scroll background when modal is open #1559
[SAGE-518] Modal - remove ability to scroll background when modal is open #1559
Conversation
I'm seeing the |
@@ -36,6 +36,11 @@ export const Modal = ({ | |||
} | |||
); | |||
|
|||
useEffect(() => { | |||
document.body.className = 'sage-page--has-open-modal'; | |||
return () => { document.body.className = ''; }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job...resetting the class when the Modal unmounts :chefkiss:
I'll look into this |
01085ec
to
02142b3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Working as expected. Nice work! 🔥
I also enabled the bridge and then ran the spec that was causing the headache with the last iteration and it's passing as well.
May want to add the pipelines blueprint pages as an area that QE should check as well just in case.
@@ -23,6 +23,6 @@ $-banner-height-offset: map-get($sage-banner-heights, default); | |||
margin-bottom: sage-spacing(); | |||
} | |||
|
|||
.sage-page__has-open-modal { | |||
.sage-page--has-open-modal { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
60c887f
to
d1be6eb
Compare
Description
Screenshots
Testing in
sage-lib
Visit the Modal page and verify that
.sage-page--has-open-modal
is present in the<body>
when a modal is open to prevent background scrolling.Testing in
kajabi-products
<body>
when modal a modal is open.Related
Closes SAGE-518