open-admin icon indicating copy to clipboard operation
open-admin copied to clipboard

Form DateRange Field does not work when using in NestedForm

Open lluisandreu opened this issue 1 year ago • 1 comments

Describe the bug The field "RangeDate" doesn't work when placed inside a nested form, like a "hasMany" nested form.

$form->hasMany('availabilities', __('Rango de fechas'), function (Form\NestedForm $form) { $form->dateRange('start', 'end', __("Fecha inicial")); })

It's because all rangeDate fields share the same ID, in this case "start" and "end" and that crashes the javascript.

All fields placed inside a nested form should have a different ID, for example appending the row index.

lluisandreu avatar Nov 13 '23 13:11 lluisandreu

Hi there

I can confirm this

Also on update

(Works on create) but loses things go awry on update form

RCyrix avatar Dec 31 '23 09:12 RCyrix