Search bar initially shows "No results found"
Setup
- Rancher version: 2.7-head
Describe the bug When adding users to a project, the search bar doesn't show the matching results until the 2nd character is typed.
To Reproduce
- Under Users & Authentication, create a new user (the kind of permissions are not relevant for this issue)
- Create a project in a cluster
- In the Members sessions, click Add
- Type the name of an existing user
- Observe the behavior of the search bar
Result When adding users to a project, the search bar doesn't show the matching results until the 2nd character is typed. Also, the search engine shows the wrong message of "No results found"
https://github.com/rancher/dashboard/assets/70187881/52d342d7-e867-4675-99e7-1d08d23ffeef
Expected Result The search bar must show all matching results from the first character typed, and show the "No results found" message only when there are no matching results at all
I think the backend requires a minimum of 2 characters to return results, so we should handle that in the UI.
~~Closing as a duplicate of https://github.com/rancher/dashboard/issues/12358~~
Switching the relationship since this already has a PR open.
Tests fail as there's some unexpected behavior: According to the screen recording, the search bar behaves as expected only if the user has the search bar in focus. If the user clicks the dropdown of results, they can still input in the search bar, but then there's no return in the search results.
https://github.com/user-attachments/assets/bc61cdbf-83de-4797-9e1f-022e9b11a41e
Reopening the issue
@IsaSih , the problem that you're seeing is not related to this PR. If you check this video, I am running 2.13-rc.3 and the problem is there already, so you've found another older bug apparently 😅
https://github.com/user-attachments/assets/3a987247-3e8e-4013-bbdd-4d039f32a415
I'll create an issue for it, but I think that it's not a reason to block this issue since tit was already there 🙏 -> https://github.com/rancher/dashboard/issues/16246