Im using adminsitrate with nestedHasmany gem, and I got some errores for cocoon + turbo
currently I report a issue here:
nickcharlton/administrate-field-nested_has_many#81
when a Turbo page is loaded , the event is added to "Add" button , so If I navigate 10 times with turbo, when i click the add button, then 10 childs forms are created
I do a bad patch to fix that
replacing the add field event to remove the listener
document.querySelectorAll('.add_fields').forEach(function(element) {
// Correctly remove the event listener
element.removeEventListener('click', addFieldListener);
// Add the event listener again
element.addEventListener('click', addFieldListener);
});
function addFieldListener(e) { ...
and works.. someone knows if this is a normal issue?
Im using adminsitrate with nestedHasmany gem, and I got some errores for cocoon + turbo
currently I report a issue here:
nickcharlton/administrate-field-nested_has_many#81
when a Turbo page is loaded , the event is added to "Add" button , so If I navigate 10 times with turbo, when i click the add button, then 10 childs forms are created
I do a bad patch to fix that
replacing the add field event to remove the listener
and works.. someone knows if this is a normal issue?