Skip to content

[LiveComponent] Debounce not working when data-model is linked to parent data-model #3152

@kimu

Description

@kimu

Debouncing does not work when it is used on a child component that is linked to the parent through data-model.

Let's say we have a child component called searchField with an input.

<input type="search" data-model="value" />

and a parent that uses this component linking data-model to a prop named query

<twig:searchField data-model="query:value" />

If one wishes to delay the re-render by debouncing the input field the only place where this would be accepted is the child component

<input type="search" data-model="debounce(500)|value" />

But this has no effect. The parent data-model gets updated immediately triggering the re-render.

I have notice that many other modifiers work as expected. For instance, min_length would prevent to update the parent if the length requirement is not met.

Trying to do the same thing on the the parent

<twig:searchField data-model="debounce(500)|query:value" />

triggers an error Can't get a way to read the property "debounce(500)|query.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions