Skip to content

Conversation

@BuchiNy
Copy link

@BuchiNy BuchiNy commented May 21, 2025

User stays on the same tab

Problem

Delete a search query and make a new one; it stays on the same tab, even if there are results on the All tab. This can lead the user to think there are no results at all.

Solution

Check if the search string is blank, and if it is, set the current tab to All so that when the user starts typing, the search results start from the All tab

Changes

Modified the handleSearchTextChange function

image

Modified the updateSearchViewVisibility function

image

How it works

  1. Check the search string to see if it's empty
  2. Set the current tab index to 0 if it is empty
  3. Get the tab layout for index 0 and display it

Testing

  • Verify that when the search term is deleted/cleared with the clear button in the search bar and a new one is placed, the tab view is set to All when displaying results.
  • Verify that when the search term is deleted through the keyboard backspace and a new one is written, the tab view is set to All when the results are displayed.

@BuchiNy BuchiNy requested a review from Naomi-Nyama May 21, 2025 10:09
@BuchiNy BuchiNy linked an issue May 21, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

User stays on the same tab

2 participants