Skip to content

attribute deletion leading to deadlock #77

@sashafirsov

Description

@sashafirsov

Inifinite rendering is caused by omitting the attribute by outer CE when inner CE has the attribute enforced.

<custom-element tag="sample-input">
    <template>
        <attribute name="name"></attribute>
        <attribute name="value" select="//val"></attribute> <!-- internally enforced value exposed to container -->
        {$name}
        <label><input type="radio" name="{$name}" slice="val" value="🍏">Apple</label>
        <label><input type="radio" name="{$name}" slice="val" value="🍌">Banana</label>
    </template>
</custom-element>
<custom-element>
    <template>
        <form slice="cart-form" action="#sample-5" custom-validity="(//inp1 = //inp2) ?? 'pick same fruit'">
            <sample-input slice="inp1" name="inp-1"></sample-input> 

            <!-- contailner does not use `value` attribute ^^ which would be removed by attributes merge -->

            <sample-input slice="inp2" name="inp-2"></sample-input>
            <button>Next</button>
            Picked :{//inp1} and {//inp2}

            <p>{//cart-form/@validation-message}</p>
        </form>
    </template>
</custom-element>

In given sample the form does not pass value and sample-input value attribute is enforced.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions