Skip to content

Finding events inside a shadow element #61

@valtido

Description

@valtido

Consider the following.

<sometag .... >
   --shadowRoot--
         <style>...</style>
        <a id="test"></a>
        <script>
              $('a').on('click', function(event){  ....  })
       </script>
</sometag>

The problem is, these event's are not picked up from the VisualEvent:

Here is a way to find elements inside a shadowRoot element.

var all = document.querySelectorAll("*");
var length =  all.length
for(i= 0; i < length; i++){
  if(all[i],shadowRoot) all.concat(all[i].shadowRoot.querySelectorAll("*"));
}

Of course this is a quick and dirty way of archiving this, but may need a bit more thought and work on to it.

Let me know your thoughts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions