Skip to content

[Live Components] updateFromParent seems not to be working on dataModel parent-child binded properties #790

Open
@Jim56450

Description

@Jim56450

Imagine 2 components like this :

parent_component :

<div {{attributes}}>
    <select data-model="on(change)|postId">
        {% for post in this.posts %}
            <option value="{{ post.id }}"
                    {% if post.id==postId %}
                        selected
                    {% endif %}
            >{{ post.title }}</option>
        {% endfor %}
    </select>

    <input name="title-editor" data-model="post.title" />

    {{ component(child_component, {
        dataModel: 'post.title:title post.content:content',
        'data-live-id': 'post-edit-'~postId
    }) }}

</div>

child_component :

<div {{ attributes }}>
    <input  data-model="debounce(500)|title"/>
    <input  data-model="debounce(500)|content"/>
</div>

child_component title and content properties are both writable and updateFromParent LiveProps.

If you change title-editor input value, it will update the title in the parent component (select is re-rendered), but not in the child component.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions