It works well in dev mode, but in production mode, when bundled with steal-tools, it only works in some of the bundles. In others, the toggling still shows the content wrapper div, but the content inside the tags does not appear.
Its difficult to reproduce since this issue works when bundling the component by itself, but when using this component in multiple bundles, the issue is occuring.
I meant, the dropdown-menu is used in several bundles. So I think steal puts the dropdown-menu in a “shared” bundle that is used by several bundles.
Hi @leoj3n, thanks for taking a look. I might not have explained well, but the example you tested is the working example.
There is another example that uses the same component that doesn’t work. spectre-canjs/dropdown-menu/demo/demo.html
Those dropdowns in the second example are similar to the first, but their <content /> block is not rendered correctly. What’s odd about the second example, is the wrapper div’s do appear, but the elements contained in what should be the <content /> blocks do not appear.
I can confirm the literal <content /> tag is inserted into the DOM on the http://10.0.1.38:8080/dropdown-menu/demo/demo.html just like you said, so yes now I am able to replicate the issue on that page. There are stache errors in the browser console:
And oddly enough, in dev mode, the issue does not occur. It only happens when the items are bundled. It would make sense that the problem is in how I am building the bundles, but I have followed the correct steps as far as I know:
Could it have something to do with the fact that in the working flow the custom element is within a stache template, while in the not working flow the custom element is directly within an html file?
Maybe the problem is in the files referenced by the script tags for StealJS?
EDIT:
In the working flow, data-admin/demo/admin.js is like:
Thanks @justinbmeyer; looks like you were spot-on about the <content/> element not being registered early enough. Also, thanks @roemhildtg; caused me to learn something new