social-app icon indicating copy to clipboard operation
social-app copied to clipboard

Focus search input on Search tab soft reset

Open rshigg opened this issue 4 months ago • 6 comments

Demo

https://github.com/user-attachments/assets/e3e557b4-8036-4dcc-aa4c-7a48763334ff

Why?

This is the way the search tab works in many apps. Most notably this is something I miss from the bird site. It's not solving a huge problem but not having to stretch my finger to the top of the screen is nice when I'm feeling extra lazy.

Considerations

  • Is soft-reset the right event to listen to here? It seemed the most fitting since it's the event that fires when the tab is already selected.
  • This is a pattern I see often on iOS but can't speak for Android, does it make sense there?
  • The focused state does not get reset across page navigation, is this awkward?
    • Note: It seems that this is also the case if you manually focus the input field.
  • If this is an addition for the lazy among us, would it make sense to also add a more convenient way to blur the input?
    • For example: If there are no search results and the user presses on the page body

rshigg avatar Oct 11 '24 23:10 rshigg