iron-list
iron-list copied to clipboard
Filtering and selecting preserves actions taken on unrelated elements
Description & Actual Outcome
The iron-list
element is incorrectly binding actions across elements, on what appear to be indices. When filtering the list of elements in an iron-list
, the actions perform on the filtered list are bound to the indices. When the filter is removed, the actions performed are then incorrectly reflected on the unfiltered list indices.
Expected outcome
When performing actions on a filtered list, the unfiltered list should not be affected. The actions should be bound to the specific element that they were performed on initially.
Live Demo
Steps to reproduce
-
Initial State
-
Search for a project in the list
-
In that project, check the select all checkbox
-
Clear the search input, and expand the first project in the list, notice that the items appear checked now, even though their data has not been retrieved
-
Uncheck the select all checkbox that is incorrectly checked
-
Go back to the project that was originally filtered on, notice that the checkboxes are now unchecked as well
Browsers Affected
- [x] Chrome
- [x] Firefox
- [ ] Safari 9
- [ ] Safari 8
- [ ] Safari 7
- [ ] Edge
- [ ] IE 11
- [ ] IE 10
In your example, the checked
state of a project is correctly bound to the filteredProjectData
array, but when you toggle "select all", filteredProjectData
is reset, so you lose the checked state.
This is true, but shouldn't iron-list then also lose the checked state?
On Thu, May 18, 2017, 3:59 PM Keanu Lee [email protected] wrote:
In your example, the checked state of a project is correctly bound to the filteredProjectData array, but when you toggle "select all", filteredProjectData is reset, so you lose the checked state.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/PolymerElements/iron-list/issues/444#issuecomment-302539845, or mute the thread https://github.com/notifications/unsubscribe-auth/AJn-AzZ4vTFgINp8d1nvKyC_0972ioxyks5r7LFFgaJpZM4NfQDl .
The first <workplan-filter-list>
is also being recycled, and when you clear the search filter the first <workplan-filter-list>
will have its selectAllChecked
property set, so that's why it's checked. Haven't tried using nested <iron-list>
s before - interesting use case, but not 100% sure it'll work as expected.
So is there a way to force the iron-list to provide the behavior that I am stating above? Am I doing something incorrectly, or is this in fact an issue?
On Thu, May 18, 2017, 4:33 PM Keanu Lee [email protected] wrote:
The first
is also being recycled, and when you clear the search filter the first will have its selectAllChecked property set, so that's why it's checked. Haven't tried using nested s before - interesting use case, but not 100% sure it'll work as expected. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/PolymerElements/iron-list/issues/444#issuecomment-302547993, or mute the thread https://github.com/notifications/unsubscribe-auth/AJn-A0sonnzj2gxG8Igpc67gHD9q5cbEks5r7Lk4gaJpZM4NfQDl .
I would try making project.selectAllChecked
a property on the project and bind to that.