-
Notifications
You must be signed in to change notification settings - Fork 743
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
Advanced Router - Web Components do not render properly in <sc-view> #56
Comments
I thought that maybe it was due to the fact that I changed |
Update: when the sc-view with the web components is called in it's not loading the Shadow DOM. |
Created a pull request for the patch: #58 This change allows web components to be rendered using the router by taking the child nodes from newView and using innerHTML to copy the HTML from newView into currentView. This appears to render the HTML which triggers the web component lifecycle callbacks. It's not the prettiest way of handling it. I spent several hours working on it and towards the end @pmgower and I came up with this. Is there another solution to render the HTML being copied from newView so we don't have to use currentView and innerHTML? |
@derekshull it's always great pair-programming with you. #twoheadsarebetterthanone |
@surma For anyone willing to debug on their own lovely OS X and Safari, just add some browser polyfills:
|
I'm using web components in the router to display a couple of buttons, such as . On safari and firefox, when I route in the page with those they appear and behave as I expect with all the styles. (Just like you see when you go to this page: example)
If you use chrome to go directly to the page (example) then you'll see it appear and behave normal. BUT, if you go to another page first (like this one) and use the side-nav to go to the buttons page, they don't appear correctly.
Since this is only happening in Chrome and not Safari, FF, etc. could it be a Chrome bug? Maybe to do with how the nodes are being brought in?
The text was updated successfully, but these errors were encountered: