Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finding events inside a shadow element #61

Open
valtido opened this issue Mar 4, 2016 · 2 comments
Open

Finding events inside a shadow element #61

valtido opened this issue Mar 4, 2016 · 2 comments

Comments

@valtido
Copy link
Contributor

valtido commented Mar 4, 2016

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.

@DataTables
Copy link
Collaborator

Sounds useful - thanks! I'm not likely to have much time to look into this any time soon, but I will do so as soon as I get a chance.

@valtido
Copy link
Contributor Author

valtido commented Mar 4, 2016

Let me know if you need a demo page. I can set it up for you to test it on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant