You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wasn't able to trigger e.g. a click event on the login buttons root component.
Why do I want to do this?
I use different menus for login and logout actions. Thus I included the login button as a hidden component to the DOM and used my own buttons/menus to trigger click events on this hidden button.
So I'd like to execute document.getElementById('signin').click(), which didn't work.
I was able to achieve my expected behaviour by executing (vue.js syntax) this.$refs.signin.shadowRoot.children[1].click(). This doesn't seems stable and I guess this is not the expected usage of web components....
The text was updated successfully, but these errors were encountered:
rmeissn
changed the title
Can't trigger events to the login button
Can't trigger events on the login button
Oct 2, 2019
Thanks for pointing me to this function. I ignored it in the first place because _ seemed like a (inofficial) private function. Using this function works for my use-case.
Nevertheless, the correct way for a button (even though it is a web component) would be to issue a click event to the component, instead of calling a function that (most probably) emulates an internal click event. This should be easily addible without breaking the currently provided functions.
I wasn't able to trigger e.g. a click event on the login buttons root component.
Why do I want to do this?
I use different menus for login and logout actions. Thus I included the login button as a hidden component to the DOM and used my own buttons/menus to trigger click events on this hidden button.
So I'd like to execute
document.getElementById('signin').click()
, which didn't work.I was able to achieve my expected behaviour by executing (vue.js syntax)
this.$refs.signin.shadowRoot.children[1].click()
. This doesn't seems stable and I guess this is not the expected usage of web components....The text was updated successfully, but these errors were encountered: