boutique replica bags up ideas

the best replique rolex and prices here.

julia highlight 99j hair color 10a quality straight human hair lace front wigs 8 - 24 inches pre plucked hairline 13x4 inches lace front brazilian wig onlinefor sale

Angular Tip: Get an active element of your document if it can be in a shadow DOM?

Updated on     Kisan Patel

Problem:

How to get an active element of your document if it can be in a shadow DOM?

Solution:

/**
* Returns current active element, including shadow dom
*
* @return element or null
*/
export function getNativeFocused(documentRef: Document): Element | null {
   if (!documentRef.activeElement || !documentRef.activeElement.shadowRoot) {
       return documentRef.activeElement;
   }

   let element = documentRef.activeElement.shadowRoot.activeElement;

   while (element && element.shadowRoot) {
     element = element.shadowRoot.activeElement;
   }

   return element;
}

Angular JavaScript

Leave a Reply