Skip to content

interference when two templates set class on same node #434

@wkeese

Description

@wkeese

Taken from ibm-js/deliteful#587.

In the following example, the template for <test-app> sets a class on the <d-combobox> node, and <d-combobox>'s template also sets a class on its own root node (i.e. the same node). The expected behavior is that both classes show up, but only one does.

<!DOCTYPE html>
<html>
<head>
    <script type="text/javascript" src="html5/libs/requirejs/require.js"></script>

    <script type="text/javascript">
        require.config({
            baseUrl: "html5/libs"
        });

        require([
            'delite/handlebars',
            "delite/register",
            "delite/Widget",
            "deliteful/Combobox",
            "requirejs-domready/domReady!"
        ], function(handlebars, register, Widget){
            register("test-app", [HTMLElement, Widget], {
                attachedCallback: function() {
                    var templateText = '<template><d-combobox class="fill"></d-combobox></template>';

                    handlebars.requireAndCompile(templateText, require).then(function (template) {
                        this.template = template;

                    }.bind(this))
                }
            });

            register.parse();
        });
    </script>
</head>

<body >
    <test-app id="test"></test-app>
</body>
</html>

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions