Blazored / Modal

A powerful and customizable modal implementation for Blazor applications.
https://blazored.github.io/Modal/
MIT License
780 stars 185 forks source link

[Bug] Left sidebar leaves gab when modal is open #306

Closed hhyyrylainen closed 2 years ago

hhyyrylainen commented 3 years ago

Describe the bug When a modal is open the left sidebar and the top bar (both that are sticky) don't position themselves correctly.

To Reproduce Steps to reproduce the behavior:

  1. I created a reproduction case based on the WASM sample, repo here: https://github.com/hhyyrylainen/Modal (here's what I changed: https://github.com/hhyyrylainen/Modal/commit/50055e22b5d7fc49232ba98bca3ce0f5ac0e0158)
  2. dotnet run in samples/BlazorWebAssembly
  3. Open browser to http://localhost:5000/
  4. Scroll down a bit so that the "Show Modal" button is visible but the page is scrolled down at least a little bit
  5. Click on the "Show Modal" and pay attention to the bottom left. Now close the modal. See how the left side bar jumps around

update: I just tested with chrome, and noticed that this only happens with Firefox. Tested versions: Google Chrome 90.0.4430.72 Mozilla Firefox 87.0

Expected behavior I expect modals opening not messing with the site navigation bar.

Screenshots Modal is open: Kuvakaappaus - 2021-04-19 20-51-01 Then literally the only thing I do is click the modal X to close it (notice all the other changes that happened on the page): Kuvakaappaus - 2021-04-19 20-51-09

Hosting Model (is this issue happening with a certain hosting model?):

Additional context Happens both with the default and bootstrap themes.

larsk2009 commented 3 years ago

Ah the update you mentioned in the issue seems to be why I couldn't reproduce it, I was using chrome. I can see why it happens.

It happens because of this line. Not sure why it only happens in Firefox and if it is a bug in Firefox or by design.

@chrissainty what do you think?

chrissainty commented 3 years ago

This is linked to #315

chrissainty commented 2 years ago

This now appears to be fixed with the changes to the focus trap