Skip to content

[LiveComponent] ComponentWithForm prevent onUpdated to be triggered #2057

@Nek-

Description

@Nek-

If you have a component that is based on a form, and you expect your form to be updated on a data coming from the parent component (using updateFromParent) you have all the chances your component will never see the method defined in onUpdated triggered because your form may be invalid and therefore cancel any update of the component.

I noticed it is the origin of many weird errors (of data disappearing for example).

I suggest everybody to fix it this way:

    // Constructor of my component
    public function __construct()
    {
        // Avoid submitting sometimes empty data
        // also avoid so much errors
        $this->shouldAutoSubmitForm = false;
    }

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