I would like to propose to always set the cursor focus on the relevant input of modals instead of not setting it.
There’s already this PR for the input of a chat window and this should also apply to the following locations:
I would like to propose to always set the cursor focus on the relevant input of modals instead of not setting it.
There’s already this PR for the input of a chat window and this should also apply to the following locations:
Thank you for compiling the list. I agree with the suggestion.
The reason this is not working is technical.
In fact we already declare autofocus on some of the elements, e.g. in the Add Members dialog, but that is not working due to Bug: autoFocus broken inside <dialog /> · Issue #23301 · react/react · GitHub. React was made before we had the nice browser native <dialog> implementation which we use.
It’s simply because it’s the first focusable element in the dialog: Chromium focuses it when the dialog gets opened. (We also have a hack to disable this “focus first element by default” behavior when the element is a button and doesn’t have autofocus on it).