Blazored / Modal

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

[Bug] Firefox blue bar #591

Open Jimmys20 opened 5 days ago

Jimmys20 commented 5 days ago

There was an older issue about a blue bar appearing on Firefox https://github.com/Blazored/Modal/issues/501 that was closed as fixed by a newer browser version but I'm still getting this problem when using Firefox version 132.0.2. It appears because a div inside the focus-trap gets focused and disappears when you click anywhere in the page and it loses focus. You can work around the problem by using a css style like:

blazored-modal-focus-trap > div:focus-visible {
  outline: 0;
}

BlazoredModal

Also it happens only on the modals that I show automatically after the page loads (without user interaction). The modals that open later after a button click don't show the blue bar (I guess because the focus changes to the clicked button).

Can be reproduced on Firefox by editing Home.razor in InteractiveWebAssembly sample project and adding following code:

 protected override void OnAfterRender(bool firstRender)
 {
     if (firstRender)
     {
         Modal.Show<Confirm>("Welcome to Blazored Modal");
     }
 }

Modal2