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(Modal): scrolling disabled when modal unmounts #2394

Closed
wants to merge 1 commit into from

Conversation

guillaumep
Copy link

Fixes #1157, fixes #2248.

Another PR was opened for this fix, #2255. This PR is an alternative approach, possibly more generic.

At Modal mount time we check if the mount node has the scrolling class, and keep that information in a class variable (scrollingWasDefinedAtMountTime). At Modal umount, we reset the scrolling class to its original value.

I will see to add tests to the PR as well, today or next week.

Also update tests to unmount modals after usage.
@codecov-io
Copy link

Codecov Report

Merging #2394 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2394      +/-   ##
==========================================
+ Coverage   99.73%   99.73%   +<.01%     
==========================================
  Files         152      152              
  Lines        2664     2667       +3     
==========================================
+ Hits         2657     2660       +3     
  Misses          7        7
Impacted Files Coverage Δ
src/modules/Modal/Modal.js 100% <100%> (ø) ⬆️

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 4f2f3fc...645b64f. Read the comment docs.

@RetroCraft
Copy link
Contributor

This looks good. Haven't tested, so I assume it works. Feels more react-y using a variable. I've still no clue how tests work and have been busy doing schoolwork so I'm good for either my approach or yours.

@Zacele
Copy link

Zacele commented Dec 28, 2017

So have this issue fixed yet? When I unmount a modal the original modal keep frozen on the scrolling.

@layershifter
Copy link
Member

Closing in favor of #2407 as it promotes more proper solution.

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.

Modal: scrolling issue when using sub-modals Multiple modals scrolling bug
6 participants