Skip to content
This repository was archived by the owner on Dec 28, 2024. It is now read-only.
This repository was archived by the owner on Dec 28, 2024. It is now read-only.

selectedItems creates a new array with each change instead of modify the current one #152

@jorgecasar

Description

@jorgecasar

Description

Property selectedItems set a new array with each change instead off notify the additions or eliminations. This causes erratic behavior by observing nodes created from selectedItems

Expected outcome

Keep the reference value in the property and change the values.

Actual outcome

Change the array reference, creating a new one.

Live Demo

Current behavior
The selected items are managed wrong and the observer generate inconsistent data.
https://jsbin.com/fozihiw/edit?html,console,output

New behavior
The selected items are managed well
https://jsbin.com/qobuzeg/edit?html,console,output

Steps to reproduce

  1. Use an iron-selector or any element which implement iron-selectable
  2. Set multi attribute
  3. Use selectedItems in a dom-repeat
  4. Select elements and unselect in reverse order (FILO stack).

Browsers Affected

  • Chrome
  • Firefox
  • Safari 9
  • Safari 8
  • Safari 7
  • Edge
  • IE 11
  • IE 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions