You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the initSelect method of the kirki-packages/control-repeater/src/control.js file, I tested looping over the dropdown array, and that fixes the problem.
initSelect: function(theNewRow,data){varcontrol=this,// Change dropdown by dropdownsdropdowns=theNewRow.container.find(".repeater-field select"),dataField;if(0===dropdowns.length){return;}// Loop over dropdowns_.each(dropdowns,(dropdown)=>{dropdown=jQuery(dropdown);dataField=dropdown.data("field");multiple=jQuery(dropdown).data("multiple");data=data||{};data[dataField]=data[dataField]||"";jQuery(dropdown).val(data[dataField]||jQuery(dropdown).val());this.container.on("change",".repeater-field select",function(event){varcurrentDropdown=jQuery(event.target),row=currentDropdown.closest(".repeater-row"),rowIndex=row.data("row"),currentSettings=control.getValue();currentSettings[rowIndex][currentDropdown.data("field")]=jQuery(this).val();control.setValue(currentSettings);});})},
Looking forward to a resolution, thank you!
The text was updated successfully, but these errors were encountered:
Issue description:
The Repeater control's initSelect method does not work correctly when instantiating multiple Select fields
Version used:
4.2.0
Using
theme_mods
oroptions
?options
PHP error messages that might be related
JS error messages that might be related
Code to reproduce the issue (config + field(s))
In the
initSelect
method of thekirki-packages/control-repeater/src/control.js
file, I tested looping over the dropdown array, and that fixes the problem.Looking forward to a resolution, thank you!
The text was updated successfully, but these errors were encountered: