wordpress-mobile / WordPress-Android

WordPress for Android
http://android.wordpress.org
GNU General Public License v2.0
2.97k stars 1.32k forks source link

Posts/Pages List: search results are not cleared when "X" is tapped after rotating the device #12561

Open ParaskP7 opened 4 years ago

ParaskP7 commented 4 years ago

Expected behavior

Clicking on the Clear Button (X) during a configuration change (like a rotation) should clear the search query and the displayed results. Also, the overall screen state should not become inconsistent with what the user expects when rotating the screen.

Actual behavior

When searching for Site Pages or Blog Posts using a specific search query (say tags) everything works as expected. All pages or posts that match that search query are shown, as expected. Then, when clicking the Clear Button (X), the search query and results gets cleared. However, if the screen gets rotated first (a configuration change) and then the Clear Button (X) gets clicked then, the search query gets cleared but not the search results. Afterwards, rotating back to the original orientation, the state of the screen gets rurther messed up.

Steps to reproduce the behavior

  1. Open My Site
  2. Choose a site
  3. Navigate to Site Pages or Blog Posts
  4. Search for something that will produce a set of results, for example search for tags
  5. Click the Close Button (X) on the top right
  6. Observe that the search query and results gets cleared
  7. Search again for tags
  8. This time rotate the screen before clicking on the `Close Button (X)
  9. Observer that the search query and results are visible (as expected)
  10. Now click the Close Button (X) once more
  11. Observer that the search query gets cleared but not the search results
  12. Rotate the screen back to the initial orientation
  13. Observer that the search query reappears and clicking the Close Button (X) produces the same set of problems
Tested on [device], Android [version], WPAndroid [version]

Tested on Pixel 2 XL, Android 10, WPAndroid 15.4-rc-1

ParaskP7 commented 4 years ago

The above might also relate to the below open issues:

designsimply commented 4 years ago

Thank you for the report @ParaskP7!

I tested using WPAndroid 15.4-rc-1 on Pixel 3 Android 10 and verified that if I search the Posts List then rotate the device and tap "X" that it clears the form field but the results below it are still visible when they should not be. (55s)

designsimply commented 4 years ago

Tangentially related: https://github.com/wordpress-mobile/WordPress-Android/issues/11913.