mockDOMSource can't mock events for isolated nested components
See original GitHub issueThere isn’t a way to differentiate events mocked with mockDOMSource
, where nested components are listening to events on the same namespace and relying on isolation to differentiate them.
For example, something like: https://jsfiddle.net/25a74k0k/.
The only way I can think to achieve this, is to pass in a custom class to the child (made unique by the parent), add it to the elements being listened to, and then use that custom class when selecting them. However, this is complicating the way a child must be initialised and basically duplicating what we are getting from isolate
on the real DOMSource
.
Also, in cases where :root
is the only selector used, the child would have to wrap the root element in another element to be able to select the custom class, which bloats the mark up.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (4 by maintainers)
Top GitHub Comments
Done in Cycle DOM v10.1.0
Lifting this from priority 3 to 4.