Bug Report:
-
Hi Konrad!
I have a small bug report for you (along with a fix as usual). π
In a frontend
acf_form(), I have an ACFE enhanced Flexible Content field. One layout includes an ACF Date Picker subfield.Existing rows work correctly. The same field also works correctly in wp-admin.
But when I add a new Flexible Content layout on the frontend, the Date Picker input does not open the calendar reliably. It looks like the cloned input can keep the jQuery UI
hasDatepickerclass and generatedid, so jQuery UI treats it as already initialized.A small workaround fixed it on my site:
acf.addAction('append', function ($el) { $el.find('.acf-field[data-type="date_picker"]').addBack('.acf-field[data-type="date_picker"]').each(function () { let field = acf.getField(jQuery(this)); if (!field || field.get('type') !== 'date_picker') { return; } let $input = field.$inputText(); if (!$input.length || $input.data('datepicker')) { return; } $input.removeClass('hasDatepicker').removeAttr('id'); field.initialize(); }); }, 20);It seems ACFEβs frontend Flexible Content append flow may need to reset cloned Date Picker inputs before ACF initializes them.
Thanks!
You must be logged in to reply to this topic.