You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When both the multi and fallback-selection attributes are set on an <iron-selector> in HTML, the first property flush throws in IronMultiSelectableBehavior.
Description
When both the
multi
andfallback-selection
attributes are set on an<iron-selector>
in HTML, the first property flush throws inIronMultiSelectableBehavior
.When these two attributes are used together, the
_checkFallback(fallbackSelection)
observer inIronSelectableBehavior
runs before themultiChanged
observer inIronMultiSelectableBehavior
.multiChanged
would normally updatethis._selection.multi
, whichIronSelection
uses to determine whether or not to return the full array of selected items or just the first item. However,_checkFallback
is called first, which eventually calls down into_updateSelected
, which readsthis.multi
and calls_selectMulti
._selectMulti
assumes it's safe to consider the result ofthis._selection.get()
to be an array, butthis._selection.multi
has not been updated yet andthis._selection.get()
returnsundefined
rather than an empty array, causing an error to be thrown on gettinglength
.Expected outcome
The initial property flush succeeds without throwing.
Actual outcome
The initial property flush throws an error on the first
connectedCallback
.Live Demo
https://js-kt759o.stackblitz.io/ (https://stackblitz.com/edit/js-kt759o)
Steps to reproduce
In HTML
<iron-selector>
with themulti
andfallback-selection
attributes set.Browsers Affected
The text was updated successfully, but these errors were encountered: