Skip to content
This repository was archived by the owner on Feb 4, 2018. It is now read-only.
This repository was archived by the owner on Feb 4, 2018. It is now read-only.

Add deep flag for traversing down shadow trees. #18

@treshugart

Description

@treshugart

This would effectively fill what the shadow-piercing combinator enabled. No matter how deep the element you're trying to select is, it should find and return it. The only catch is that selectors will still be bound to shadow boundaries, which I think is fair.

The deep flag should be added to the walk() function as an option. It will be passed by anything that uses walk() internally, such as: one(), all() and has().

mount(<my-component />).one('a.some-deep-element', { deep: true });

Where <my-component /> contains the a several shadow trees down.

To work on existing nodes:

mount(document.getElementById('app')).one('a.some-deep-element', { deep: true });

A more common use case might be with Selenium where you'd find something by text content, or by a query that cannot be expressed by a selector or complete node:

mount(document.getElementById('app').one({ textContent: 'Submit' }, { deep: true });

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions