Closed wikub closed 1 month ago
Ok, I found a solution with the "debounce", but I had applied it wrongly because directly on an entity object.
In the twig :
{{ form_row(form.operationDate,
{'attr': {
'data-model': 'debounce(100)|account_transaction.operationDate'
}}
) }}
And it works
Hello,
I implemented LiveComponent on my form containing a date and other fields.
I use a DateType field compatible with html5. When I use my form and type a date that starts with 0 (eg: 05/10/2024), I have the following error: "Expected argument of type "DateTimeImmutable", "null" given at property path "operationDate".
When the date is greater than the 9th of the month (eg: 15/10/2024), I have no problem.
The entity
Here my form :
Here my component
In my example the entity with the value operationDate filled in. When I start changing the first two digits (the first of which starts with 0) (dd/mm/yyyyy format) and the cursor moves to the month, a request (ajax via symfony ux) is triggered and causes the error.
Here is the data that was posted
the new date is send empty
I'm trying to apply a debouncing on this field, but I can't do it. I break the automatic update of LiveComponent for this field.
symfony/ux-live-component 2.20