Skip to content

[LiveComponent] LiveAction argument do not allow a closing parenthesis #1283

Closed
@easis

Description

@easis

Hi! I have a component where I list some strings and a user selects one of them.

I found that if I have a Live Action argument with a closing parenthesis like this

<button type="button" data-action="live#action" data-action-name="myAction(foo=bar(123))">Action</button>

it throws the error: Missing space after myAction due to this.

I was expecting to enclose the argument values with single or double quotes but checking the directive parser it seems this is not supported (yet?):

<button type="button" data-action="live#action" data-action-name="myAction(foo='bar(123)')">Action</button>

To workaround this I'm encoding the strings in hex (with a custom Twig filter) and decoding in the component function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions