Pnp-modern-search: Filter panel appears when clearing search terms but no filters selected

Created on 12 Jul 2021  路  5Comments  路  Source: microsoft-search/pnp-modern-search

Version used
4.2.2.0

Describe the bug
When searching and going through a process of selecting filters and trying different search terms, the panel filter opens even if no filters are selected

To Reproduce
Steps to reproduce the behavior:

  1. Select a filter and close panel
  2. Enter a search term with no results - panel opens
  3. Clear filters - results appear. Close panel
  4. Clear search term with x button - panel opens, but no filters are selected

Expected behavior
Filter panel shouldn't open unless the user accesses the filters or if there are no results.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):
Edge

Additional context
The page contains:

  • Search box
  • Results
  • Using Panel Filter
bug v4

Most helpful comment

Hi @jamesdellowE2 this should be resolved in the develop branch and available in the next release. Thanks!

All 5 comments

I am facing the same problem. Also, is there a way so that I can set Target Audience on Vertical webpart

@FranckyC seems state of the filter panel is dependent on if a filter was selected at one time or not - an not on explicit open/close. Not sure how best to set this as the web-component is recreated on each render. But passing in open/close should not be needed if state can be kept internally.

@wobba you're right the issue is at web component level because the state is lost after every re-render. We need to "exterrnalize" the panel open state in a dedicated variable due to the Handlebars constraint. I'll see what I can do here.

@Viipiin short answer no but please don't mix multiple questions in the same issue as this is not related.

Hi @jamesdellowE2 this should be resolved in the develop branch and available in the next release. Thanks!

Was this page helpful?
0 / 5 - 0 ratings