Esri / calcite-design-system

A monorepo containing the packages for Esri's Calcite Design System
https://developers.arcgis.com/calcite-design-system/
Other
289 stars 76 forks source link

[List] - renamed list items are still present in filtered lists #10204

Open sagewall opened 2 months ago

sagewall commented 2 months ago

Check existing issues

Actual Behavior

If a list-item's label, value, or description properties are modified after a list is filtered, the renamed list item is still present in the list.

rename_filter_text

Expected Behavior

The list item who's properties were modified and no longer are matched by the filterText are filtered from the list.

Reproduction Sample

https://codepen.io/sagewall/pen/LYKrKWY

Reproduction Steps

  1. Open the codepen
  2. Enter some text in the filter input. "water" works well.
  3. Click on the action button to set new list item property values.
  4. Using your browsers developers tools, inspect the renamed list-item.
  5. Notice how the list item's html attributes are not updated in the DOM. They are updated in the table elements inside the shadow root, but not at the list-item attribute level.

Reproduction Version

2.12.0

Relevant Info

Independent of browser or operating system

Regression?

N/A

Priority impact

impact - p2 - want for an upcoming milestone

Impact

Impacts the Map Viewer team when users rename layer's and tables in filtered lists.

Calcite package

Esri team

ArcGIS Map Viewer

driskull commented 2 months ago

I think for this use case we can maybe introduce a filter method that a user can call when they need to do so. What do you think @jcfranco?

geospatialem commented 1 month ago

As a workaround the above can currently be achieved by removing and re-creating the element.

sagewall commented 1 month ago

Sorry, I was just looking at this again and it looks like the property changes I'm making to the list item in the JavaScript code are not reflected in the DOM. Only the table elements inside the shadow DOM seem to be updated. The calcite list item element shows the old property values. I was looking at the wrong element when I wrote the issue. I'll update the description up top.

image
driskull commented 1 month ago

They are being updated, they are just not reflected to attributes. The properties are updated.