PolymerElements / iron-selector

Manages a list of elements that can be selected
32 stars 55 forks source link

One test failure in Chrome: test/multi.html » multi » updates selection when dom changes #86

Open cdata opened 8 years ago

cdata commented 8 years ago

This error started occurring with the addition of ShadowDOM-specific tests.

reinert commented 8 years ago

maybe related to https://github.com/PolymerElements/iron-selector/issues/75?

bicknellr commented 8 years ago

The MutationObserver that Polymer.Base.async uses to queue microtasks is added earlier than the one that the iron-selector uses to monitor its children, so it ends up getting called first: adding a 1ms delay to the last async call in that test (causing it to use setTimeout) makes it pass. (JSBin showing this behavior.)

invokeLast strikes again!