Skip to content

Search bar bugged interactions with empty query #4525

@jorgeltd

Description

@jorgeltd

Describe the bug

DSpace version: Tested on demo page which is currently 9.1 Snapshot, but this bug exist since 7.6 at least

The search bar interaction with an empty query is weird. 3 examples of this below.

To Reproduce

Steps to reproduce the behavior:
1.1. Search a term like "test" using the search bar in the home page of DSpace OR go directly to this search link.
1.2. Now clear the search text and press search
1.3. This browser URL will be updated but the content stays the same. NOTE: the updated URL is valid

Using an empty query as starting point
2.1 Press search button in the home page with the query bar empty OR go directly to this search link
2.2 Input a query in the search bar like "test" and press search (results will be updated with fewer items)
2.3 Now clear the search text and press search. All items will be displayed, which was the original query.

Using and empty query after two non empty search queries.
3.1 Search a term like "test" using the search bar in the home page of DSpace OR go directly to this search link.
3.2 Search for a new term with the search bar like "paper". Items with this term will be displayed.
3.3 Now clear the search text and press search. The page will display results for the term "Test"

Expected behavior

For the three previous cases, the handling of an empty query is quite different and somewhat annoying. In all cases of navigation, I think that if an empty query is requested, all items should always be displayed.

Metadata

Metadata

Assignees

Labels

affects: 7.xIssue impacts 7.x releasesaffects: 8.xIssue impacts 8.x releasesaffects: 9.xIssue impacts 9.x releasesaffects: mainIssue impacts "main" (latest release).bugcomponent: Discoveryrelated to discovery search or browse systemhelp wantedNeeds a volunteer to claim to move forwardusability

Type

Projects

Status

✅ Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions