Greater-London-Authority / ldn-viz-tools

https://greater-london-authority.github.io/ldn-viz-tools/
1 stars 0 forks source link

Opening Modal breaks scroll #85

Closed ChrisKnightLDN closed 10 months ago

ChrisKnightLDN commented 1 year ago

Describe the bug In an app with a modal scrolling is disabled once the modal has been opened

To Reproduce Steps to reproduce the behavior: on an app with an 'open modal' button and content long enough to trigger scroll:

  1. click open modal
  2. close modal
  3. try to scroll

Expected behavior After the modal is closed scrolling the page should be possible

Screenshots If applicable, add screenshots to help explain your problem. image image image

Desktop (please complete the following information):

Additional context A style is applied to the html on opening the modal: image This doesn't seem to be cleared on close This bug does not does not seem to happen on storybook. Where css properties are cleared as expected

jamesscottbrown commented 1 year ago

This doesn't seem to be cleared on close This does not seem to happen on storybook.

In both storybook and the ev charging dashboard, these CSS properties are set on the <html> tag when the modal is opened and then cleared when the modal is dismissed (this is easy to miss in storybook, since the story is inside an iframe so there are multiple <html> elements).

ChrisKnightLDN commented 1 year ago

Yes - sorry the comment wasn't clear - The bug is not present in storybook - because the css properties are correctly cleared when the modal is dismissed. On the effected app the css properties are not being cleared.

ChrisKnightLDN commented 10 months ago

I think this was a problem due to hmr in dev. Closing for now.