thunder-app/thunder

Search input field never gets unfocused, keeps bringing up keyboard

Opened this issue · 1 comments

Description
Search text input field doesn't get automatically unfocused and keeps bringing up keyboard in other screens. So far, pressing enter on the search field is the only way I've found to fix this behavior without needing to close and reopen the app. It's easy to forget to do that when search results appear as you type, though.

How to Reproduce
Steps to reproduce the behavior:

  1. Go to the search tab
  2. Focus the text input field, but don't press enter
  3. Go to any other screen and start interacting with it
  • Open and then close community, upon returning, keyboard pops up
  • Press post thumbnail to open image, upon closing it, keyboard pops up
  • Select settings category (e.g. 'Gestures'), upon returning, keyboard pops up
  • Change accounts by long pressing the button on the navbar, keyboard pops up
  • Open sidebar, then close it, keyboards pops up

Expected Behavior
The search field shouldn't bring up the keyboard when you're not on the search screen. It should probably be unfocused when the user goes to another screen or interacts with any search results.

Device & App Version:

  • Device: Asus Zenfone 3 Zoom
  • OS: Android 8
  • App Version 0.2.8

Additional Context

Random idea from someone trying to learn Flutter: maybe unfocusing the search field at onDestinationSelected in bottom_nav_bar.dart could help? No need to answer, and I defer to your experience. Might try it later.

May have found another bug while testing this, unsure if related.

Note that even while browsing search results, the keyboard is brought up every time you return to them. Specifically when searching posts, however, tapping a thumbnail while the keyboard is still open erases the search field and clears all results.

Thanks for the detailed report!

maybe unfocusing the search field at onDestinationSelected in bottom_nav_bar.dart could help?

If you'd like to give it a try, by all means go ahead! I think thats a reasonable approach to solving this issue.