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 scroll lock issue for iOS #477

Closed
wants to merge 1 commit into from

Conversation

pc035860
Copy link

Sorry for the late PR.

As I mentioned in #462, I end up using a new ref for modal container for body-scroll-lock to address the issue.
And I'm already using this build in production e-commerce site.

Related issues: #462, #468

@pc035860
Copy link
Author

BTW, the scroll lock issue sometimes actually caused by #470, since the "close modal" behavior doesn't triggered properly by the animation end event.

So to test if the scroll lock issue is fixed, make sure animationDuration or applied animation-duration style is greater than zero.

@@ -187,7 +188,7 @@ export const Modal = ({
useModalManager(refModal, open);

// Hook used to manage the scroll
useScrollLock(refModal, open, showPortal, blockScroll);
useScrollLock(refModalContainer, open, showPortal, blockScroll);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really understand this change, you are passing refModalContainer instead of refModal, but on line 307 you actually changed the name, so it means you are passing the exact same value as before. I don't get how this can fix the problem?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. The scroll lock somehow get fixed on my site, and probably not relating to this commit.
I'll look into it again.

I'll close the PR for now.

@codecov
Copy link

codecov bot commented May 20, 2021

Codecov Report

Merging #477 (b416559) into master (23cccc6) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #477      +/-   ##
==========================================
+ Coverage   97.20%   97.22%   +0.01%     
==========================================
  Files           6        6              
  Lines         179      180       +1     
  Branches       66       65       -1     
==========================================
+ Hits          174      175       +1     
  Misses          5        5              
Impacted Files Coverage Δ
react-responsive-modal/src/index.tsx 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 23cccc6...b416559. Read the comment docs.

@pc035860 pc035860 closed this May 20, 2021
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.

None yet

2 participants