Skip to content

[List] filterText and filterEnabled not initializing properly on load #6523

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
geospatialem opened this issue Feb 24, 2023 · 2 comments
Closed
Assignees
Labels
4 - verified Issues that have been tested, confirmed as mitigated, and are ready to close. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. Calcite (dev) Issues logged by Calcite developers. impact - p1 - need for current milestone User set priority impact status of p1 - need for current milestone

Comments

@geospatialem
Copy link
Member

geospatialem commented Feb 24, 2023

Actual Behavior

The list component's filterEnabled and filterText are not performing as-expected on initialization, where:

  1. When a filterText value is added on initialization, all child list-items are hidden.

  2. Additionally, when filterEnabled is true on initialization a console message is displayed:

"No data was passed to the filter function. The data argument should be an array of objects"

Expected Behavior

On initialization:

  1. filter-text should depict the correct child list-item elements
  2. filter-enabled should not load a console message

Reproduction Sample

https://codepen.io/geospatialem/pen/BaOLpbN

Reproduction Steps

  1. Open the sample
  2. Observe the console error of "No data was passed to the filter function. The data argument should be an array of objects"
  3. Observe no list-items are present when a filter-text value is entered during initialization
  4. Remove the filter-text value and observe all list-items present
  5. Enter in a new filter-text value in the input and observe list-items will filter as the text is entered

Reproduction Version

1.0.7

Relevant Info

We had a similar fix with #4207, which could be a similar solution to mitigate. cc @jcfranco

Regression?

No response

Priority impact

p1 - need for current milestone

Impact

No response

Esri team

Calcite (dev)

@geospatialem geospatialem added bug Bug reports for broken functionality. Issues should include a reproduction of the bug. 0 - new New issues that need assignment. needs triage Planning workflow - pending design/dev review. labels Feb 24, 2023
@geospatialem geospatialem removed the needs triage Planning workflow - pending design/dev review. label Feb 24, 2023
@github-actions github-actions bot added Calcite (dev) Issues logged by Calcite developers. impact - p1 - need for current milestone User set priority impact status of p1 - need for current milestone labels Feb 24, 2023
@jcfranco jcfranco self-assigned this Feb 28, 2023
@jcfranco jcfranco added 2 - in development Issues that are actively being worked on. and removed 0 - new New issues that need assignment. labels Feb 28, 2023
jcfranco added a commit that referenced this issue Mar 2, 2023
**Related Issue:** #6523

## Summary

This fixes initial filtering on consumers of `calcite-filter`. 

### Notable changes

#### `list`

* `updateListItems` (private) is no longer debounced to allow updated
values to be passed to the internal filter. This was also called
whenever the items are modified (`MutationObserver`), so this could be
revisited later if we see noticeable impact on performance
* Corrected assertion where filteredItems and filteredData were not
matching (one reflects the other)
* Added new test

#### `filter`

* Removed a duplicate `filter` call that would interfere with the
initial one – (introduced
[here](#5471), possibly
an oversight)
* Restored skipped test
* Updated test to cover filtering with default filter text
@jcfranco jcfranco added the 3 - installed Issues that have been merged to the "dev" branch and/or are ready for QA/QC. label Mar 2, 2023
@github-actions github-actions bot assigned geospatialem and unassigned jcfranco Mar 2, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2023

Installed and assigned for verification.

@jcfranco jcfranco removed the 2 - in development Issues that are actively being worked on. label Mar 2, 2023
@geospatialem geospatialem added 4 - verified Issues that have been tested, confirmed as mitigated, and are ready to close. and removed 3 - installed Issues that have been merged to the "dev" branch and/or are ready for QA/QC. labels Mar 2, 2023
@geospatialem
Copy link
Member Author

Verified in 1.0.8-next.4

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 - verified Issues that have been tested, confirmed as mitigated, and are ready to close. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. Calcite (dev) Issues logged by Calcite developers. impact - p1 - need for current milestone User set priority impact status of p1 - need for current milestone
Projects
None yet
Development

No branches or pull requests

3 participants