bonbon-web-browser
bonbon-web-browser copied to clipboard
No focus when renaming a collection with right click.
- Right click a collection and press Rename.
- Start typing and it will not be renaming your tab, it may be typing somewhere else where you last had focus.
Make sure that a the name is in focus when renaming so you can start typing without having to click the name after pressing rename.
Cannot reproduce, see video. I will still submit a PR that force focus. Edit: there is already a code doing exactly this in TopBar.tsx. Not sure how I can help you with this ticket. I assign it to you. (May be it deserves a timeout?)
useEffect(() => {
if (isRenaming) {
const target = document.getElementById(
'TopBar__tab-renaming'
) as HTMLInputElement;
target?.select();
}
}, [isRenaming]);