bonbon-web-browser icon indicating copy to clipboard operation
bonbon-web-browser copied to clipboard

No focus when renaming a collection with right click.

Open dcallus opened this issue 2 years ago • 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.

dcallus avatar Aug 14 '22 11:08 dcallus

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

danielfebrero avatar Aug 15 '22 16:08 danielfebrero