Skip to content

When filter is applied on si-filtered-search, we get two calls for searchCriteriaChange() #1030

@shubham1121

Description

@shubham1121

Prerequisites

  • I have read the Contributing Guidelines.
  • I have not leaked any internal/restricted information like screenshots, videos, code snippets, links etc.

Affected component

Summary

When filter is applied on si-filtered-search, we get two calls for searchCriteriaChange().
Although, the user selected only the criteria.

First time the call, comes with, criteria as [ ](empty array ) but the value of free text search as "criteria-label".
Second time the call, comes with criteria having 1 object with name as "criteria-label" and its value "" (empty string).

Can we somehow differentiate between a call for free text search and the first call we get on applying just the filter w/o any value for it.

Or maybe if possible to have only single call on applying criteria.

Version

element-ng: 47.7.0

Steps to reproduce

As per the attached demo video.

Code reproduction example

https://element.siemens.io/element-examples/#/overview/si-filtered-search/si-filtered-search-multiselect?q=si-filtered

What is the current bug behavior

As we can see below there are two logs coming when we just selected the criteria.

Image

What is the expected correct behavior

We only get call once, when we select a search criteria.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions