Skip to content

[LiveComponent] Allow disabling the error modal in production #1891

Open
@YummYume

Description

@YummYume

Hello 👋

Live components have a great error modal when something goes wrong on the server, however, it currently displays even in production, and I believe it's often not a wanted behaviour to display an error. I'm aware that it's possible to use the response:error event to stop the modal from rendering, but it would be great if we could do that globally (for all live components at once). Should it be a good idea to dispatch the error event on the window as well for that purpose ? It could then be easy to dispatch a toast each time an error occurs.

Another issue with the current handling of errors is that loading states are not removed, which means that, for example, a disabled submit button will stay disabled. This is explained in #1463. I believe this can be easily fixed by triggering the loading.state:finished event after handling the error. What do you all think ?

PS : The modal could use some accessibility improvements, I'm up for a PR

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