Open Ri-Sharma opened 5 months ago
Somewhat related to #2383
Ha - I removed the tag "Bug" because I was thinking that this was more of an enhancement. But then I looked at your PR and I see that we already have code which is supposed to handle the autofocus. It doesn't work so I guess it is a bug after all 🙃
It seems like the
if (renameInput.current) {
renameInput.current.focus();
}
is getting called too early - before the input is mounted and therefore it doesn't do anything. One fix might be to wrap that part in a setTimeout
with a 0
ms delay, such that it gets executed on the next render.
Actual Behavior
When attempting to rename a collection, the input field does not automatically focus, leading to a slight inconvenience in the user experience.
Expected Behavior
Upon pressing the rename button, the input field should autofocus, similar to the behavior observed when renaming a sketch
Steps to reproduce: