Skip to content

Fixing search results click bug

Pranav Tiwari requested to merge 145-search-results-click-bug into master

Cause of the bug -

When clicking a search result, the selectSubject action was being triggered twice.

  1. Once by the onClick method on the list item, which is expected,
  2. and once by the computed method subjects.

The reasoning behind the 2nd dispatch method is to automatically select the first item after a search is done. But the conditions used were not sufficient to distinguish a search, and so it was being triggered even when the list item was being clicked.

Solution - Adding a state variable in the store to accurately identify the search finished event and trigger the selection of the first item.

Merge request reports