homepage icon indicating copy to clipboard operation
homepage copied to clipboard

Refocus on search input after clicking "X"

Open akdeb opened this issue 1 year ago • 1 comments

https://github.com/phosphor-icons/homepage/blob/e6b05451944d27fdf99be351894eb660d14e40b1/src/components/SearchInput/SearchInput.tsx#L71C1-L76C5

I noticed this was something I'd like when I was using the website. Perhaps its a good idea to refocus on the search bar once the SeacrchInput's "X" button is clicked.

This would end up looking like:

  const handleCancelSearch = () => {
    setValue("");
    inputRef.current?.focus();
    // Should cancel pending debounce timeouts and immediately clear query
    // without causing lag!
    // setQuery("");
  };

akdeb avatar Feb 13 '24 10:02 akdeb

@akdeb solid point, I'll fix this!

rektdeckard avatar Mar 06 '24 18:03 rektdeckard