BonBon-exchange/bonbon-browser

No focus when renaming a collection with right click.

Opened this issue · 1 comments

  1. Right click a collection and press Rename.
  2. 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]);

Recording 2022-08-15 at 18 09 48