-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
@children Only Working in Chrome #655
Comments
@TonyLugg Thanks. Can you please post your markup and the piece of your typescript code that declares and consumes the |
I did some digging and it seems the implementation differs based on whether you're having So for starters, you should probably either remove that |
@bigopon you probably want to know about this too. Previous discussion at aurelia/aurelia#331 |
items is undefined when logged in Edge |
In Chrome I actually don't need to reference el.au.controller.viewModel, as the vm's are right there in the array of children. |
|
@StrahilKazlachev Correct. All items in View HMTL. Each custom element has a slot (menu-list and menu-list-item). menu-list can create multiple menu-list-item's, menu-list-item can contain visual content and a single menu-item (a sub menu). |
Yeah if you use slots then the view compiler enables ShadowDOM mode for the custom elements. @TonyLugg You could either try polyfilling ShadowDOM in Edge with shadydom, or you can use That said, this is still a valid issue as I believe we should be able to detect whether something is really shadowDOM or not, and if not, use the appropriate initialization logic. |
For vCurrent, you can use slots without ShadowDOM. If you do, the framework attempts to emulate. If you specify |
@EisenbergEffect I had originally not used |
Can you create a simple repro based on the Aurelia CLI and attach it here? I'd like to take a look myself. This seems pretty surprising to me so either there's something not quite right in your project or we've had a major regression at some point. |
OK, I'm tied up for a few days but will get something for you soon. |
@EisenbergEffect See #655 (comment) This in turn causes the children observer to go into a different traversal mode which doesn't work. I'm fairly sure it has been like this for a long long time. I also recall issues with slots + |
Using slots in vCurrent should never force shadow dom to turn on. That's the whole reason for having slot emulation to begin with. If that is what is happening, then this is some sort of regression. It's definitely not always been that way. |
I just created a little sample in Aurelia Typescript Sandbox and it works there in all browsers. My real test app is using CLI Webpack config. Also, the custom elements are global resources. I'll create a new CLI project and see what happens. |
I created a new CLI app with Webpack and TypeScript and used the same files as the sandbox linked above. Now I get the original results, i.e. it works in Chrome but not in FF or Edge. |
Do you mind zipping that up and attaching it here? |
Here is the test project, sans node modules. |
Thanks! I'm on vacation and traveling a bit but I'll try to take a look over the next couple of days. I may have some more specific questions after I dig in more. |
OK, first, have your well deserved vacation, this can wait until you return. It is pretty simple. CLI new app, add the app.html. Add the two custom elements. Check the console in each browser. That's it for this crude sample. |
Firefox Chrome Edge @TonyLugg The outputs in the console look identical to me. Can you help me understand what is different in Edge or Firefox in your local build, please? |
I finished the multi-level menu using |
@TonyLugg Did you get your issue resolved? |
@TonyLugg I'm finally able to have a look at the cause of this. In short, this is a timing issue. It can be explained like this:
|
Using
@children
in a custom element is only working in Chrome. Adding@useShadowDOM
to the custom element got it working in FireFox but it does not work in Edge. My elements have slots and two types of custom elements can be nested within each other forming a multi-level menu.@fkleuver This is a carry over from our discussion in the vNext space.
The text was updated successfully, but these errors were encountered: