
Loading…
array-selector doesn't work with `multi` unless `toggle` is specified #1810
I think the toggle example, at least, is a bug in array-selector; it doesn't seem to update the selection if toggle isn't set.
Changed this title to better describe the bug you're seeing in #1. Here's a jsbin using a fixed branch:
http://jsbin.com/guxijoyodi/1/edit
As you can see, select works properly without toggle, the only difference is that clicking the button a second time doesn't deselect the actor.
Not sure I really understand the questions in #2, but it seems like part of the problem is that the use cases for <array-selector> aren't described very well?
@arthurevans The renamed title is accurate of the original meaning of the article, & the fixed branch has indeed the expected behavior I was expecting.
As I was originally expecting, select now works properly without toggle.
Regarding #2, I'd say you're spot-on, more examples or explanation of the array-selector may be warranted. This could be as simple as more examples showing how select(item) can work outside of event handlers.
Problem 1
In the section regarding
array-selectorin the developer docs, it is unexplained the importance & relevance oftogglebeing set for the code snippet provided:If
toggleis removed, the element's behavior doesn't work as expected. I & many perhaps thought the removal oftogglemeans that that a selection canbe added to{{selected}}but not removed. Unfortunately, that isn't the case. This seems like a bug.An example of this can be found here; remove toggle & see what happens.
Problem 2
Another problem beyond the problem(s) above is showing
this.$.selector.select being used outside of an event handler. It was obvious to me inside things like thereadycallback but there may be value if it was demonstrated the following ways for developers:filter&/orsortselectedcontents when the element is detached{{selected}}being used outside the app with an outside listener by the forsight of the code defining the property name put inside theselectedattribute being available to the outside world with an event listner