Closed maximedegreve closed 2 months ago
@maximedegreve Tried to reproduce and couldn't 🤔. Tested on Safari and Chrome
Are there more steps required?
https://github.com/primer/react/assets/1863771/f66f2dcc-a5c9-4171-a62b-afc54bdffb46
@siddharthkp I'm not sure why this works differently on mine here.
I've took a full window video to demonstrate my setup.
https://github.com/primer/react/assets/980622/63c5e7b4-98ee-4378-85ae-6a3d7e77c602
Figured out how to reproduce this:
MacOS → Settings → Appearance → Show scroll bars → Always
Why does it happen:
overflow: hidden
on <body>
which hides the scrollbar and causes a horizontal shift.Not sure what's the move here. cc @mperrotti any ideas?
@siddharthkp this is likely related, I believe it wasn't like this before we switched the component here recently 🤔:
https://github.com/user-attachments/assets/98772be2-28bf-42f1-938b-85f0832dc671
Yep, same component. The change isn't new (July 2023) but as the Dialog gets more usage, this keeps popping up in more places
If we remove this behavior, you end up background scrolling, see video:
https://github.com/user-attachments/assets/653f814e-1a33-46aa-8bdf-ce12dc04def5
Notes:
overscroll-behavior: contain
would help but only if the dialog has overflow not if the dialog does not have overflow like in the sidebar example (browser bug report: chrome, safari)@keithamus @mperrotti Can I borrow your minds here?
Looks like --dialog-scrollgutter
isn't being applied which is causing the shift in the underlying body content...
But that's not the issue @maximedegreve is describing here, is it? It looks like OP describes the focus of the dialog starting on the 4th element. Native <dialog>
does solve for this; it'll focus the first focusable item, or the item marked with the autofocus
attribute. I presume there's a bug in our focus trap code which our React dialog is using.
@keithamus is correct. This is not about the scrollbars here.
Oh, my bad. I may have mixed a different issue with this one and went on the wrong track
I tried reproducing the focus jumping and could not reproduce it in Safari or Chrome 😔
I presume there's a bug in our focus trap code which our React dialog is using.
That's possible, @keithamus were you able to reproduce it as well?
Confirmed with @maximedegreve, we can't reproduce it anymore. My guess is that this was a bug in the recipes component that has now been fixed. Can reopen if we see this or a similar bug again
Description
I've made a Dialog that has 4 items you can choose from (ActionList items). When I open the dialog, it automatically highlights the last item you can choose.
There are multiple problems happening here.
https://github.com/primer/react/assets/980622/f750b27c-8c1e-4e5d-925d-5f644d156f4e
Steps to reproduce
Assigned
Version
Latest
Browser
Safari