react-responsive-modal icon indicating copy to clipboard operation
react-responsive-modal copied to clipboard

Add keepMounted option and fix screen glitch

Open pikaju opened this issue 1 year ago • 5 comments

Adds option that keeps the Modal mounted even when it is hidden. This is useful for keeping the DOM state inside the Modal as well as for SEO purposes.

Fixes #233 and #495

pikaju avatar Feb 14 '23 20:02 pikaju

Thanks for the pr! Could you please add an example in the docs so I can try it?

pradel avatar Mar 09 '23 10:03 pradel

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.16 :tada:

Comparison is base (16aad65) 95.28% compared to head (d2c9bb4) 95.45%.

:exclamation: Current head d2c9bb4 differs from pull request most recent head 11fd42a. Consider uploading reports for the commit 11fd42a to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #516      +/-   ##
==========================================
+ Coverage   95.28%   95.45%   +0.16%     
==========================================
  Files           6        6              
  Lines         191      198       +7     
  Branches       69       74       +5     
==========================================
+ Hits          182      189       +7     
  Misses          9        9              
Impacted Files Coverage Δ
react-responsive-modal/src/index.tsx 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov[bot] avatar Mar 09 '23 10:03 codecov[bot]

Hey @pradel, thanks for the response. I added an example and docs in the Next project.

I also changed how modals are centered, from the "inline" behavior to flex-box centering. I did this because there was an issue when the modal had little space (e.g. on a mobile device) and the pseudo-element you had before was wrapped to a new line. This implementation doesn't do that.

pikaju avatar Mar 16 '23 17:03 pikaju

@pikaju could you please split the pr into two parts?

  • the keepMounted can be released as a minor version first
  • then the change you made to the CSS for the mobile issue, this one will need to be released as a breaking change as it may conflict with the CSS used by users of this package

pradel avatar Apr 22 '23 13:04 pradel

@pradel Sorry, but that doesn't seem worth the effort, I suggest just releasing a new major version

pikaju avatar May 04 '23 16:05 pikaju