Skip to content

Search reset button not working properly #6892

Description

@josegar74

Describe the bug
Search reset button should clean up the search fields and trigger a search to show all the results.

In some cases, the button is clicked and nothing happens. Clicking it a second time, works fine.

The issue happens in 3.12.x and main branches.

To Reproduce
Steps to reproduce the behavior:

Case 1:

  1. In the home page, filter by a topic category.
  2. In the search page, click the reset button --> Search is executed and shows all results
  3. Go (with the application logo in the top bar) to the home page and select the same topic category
  4. In the search page, click the Reset button, nothing happens.
  5. Click the Reset button a second time and then it works

Case 2:

  1. In the search page, click the search button for an empty search
  2. Write a search filter and click the search button
  3. Click reset --> First time doesn't work, second works

Expected behavior
Clicking the Reset button once, cleanups the search fields and executes an empty search to return all the results.

Additional context

The code involved it's

if (angular.equals(params, gnSearchLocation.getParams())) {
triggerSearchFn(false);
} else {
gnSearchLocation.setSearch(params);
}

When it doesn't work, executes:

the next time, that works, enters in:

But if you go directly to the search page, do a search and click reset (that seems working), executes also:

A bit unclear what is causing this wrong behaviour.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions