modern-css-reset icon indicating copy to clipboard operation
modern-css-reset copied to clipboard

Firefox bug with select and focus-within + scroll-behavior: smooth

Open kimlai opened this issue 3 years ago • 1 comments

Hello!

I've been using your reset for a while (it's great btw thanks), and I've noticed a weird bug on Firefox (87.0) and Ubuntu. When I click on a select element, the dropdown appears for a fraction of a second, then disapears (I need to click again to have the regular select behaviour). Then if I move the focus elsewhere, and click again on the select, nothing appears on the first click.

I've tracked down the problem to this part of the reset

html:focus-within {
  scroll-behavior: smooth;
}  

I've made a codepen so that you can try and see if you can reproduce the issue https://codepen.io/kimlai/pen/PoWjMyv.

I don't know what's happening, and it's most probably a bug in Firefox, but I thought that I'd let you know, since it makes the reset unusable as is (at least for me).

kimlai avatar Apr 05 '21 21:04 kimlai

I can confirm this strange bug in Firefox 88.0 on macOS. Without defining scroll-behavior it works fine.

karlschwaier avatar Apr 26 '21 13:04 karlschwaier