Why the focus is not inside the modal #13989
-
Hi, I thought that the focus will be adjusted automatically to be inside the modal once the modal opens as mentioned here: This seems happens when using createPortal. Is there a workaround for this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
You can add |
Beta Was this translation helpful? Give feedback.
You can add
data-modal-primary-focus
to theButton
you would like to receive focus: https://codesandbox.io/s/autumn-thunder-5rr35d?file=/index.js