How to use the query-selector-shadow-dom.querySelectorDeep function in query-selector-shadow-dom

To help you get started, we’ve selected a few query-selector-shadow-dom examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mkay581 / router-component / src / router-component.ts View on Github external
private scrollToHash(hash: string = this.location.hash): void {
        const behaviorAttribute = this.getAttribute('hash-scroll-behavior') as ScrollBehavior;
        const hashId = hash.replace('#', '');
        const hashElement = querySelectorDeep(`[id=${hashId}]`, this.shownPage) as HTMLElement;
        if (hashElement) {
            hashElement.scrollIntoView({ behavior: behaviorAttribute || 'auto' });
        }
    }

query-selector-shadow-dom

use querySelector syntax to search for nodes inside of (nested) shadow roots

MIT
Latest version published 1 year ago

Package Health Score

73 / 100
Full package analysis