diff --git a/client/src/components/MultipleChooserPanel/index.js b/client/src/components/MultipleChooserPanel/index.js index 2ed0ba1463..22ab8b231d 100644 --- a/client/src/components/MultipleChooserPanel/index.js +++ b/client/src/components/MultipleChooserPanel/index.js @@ -16,8 +16,15 @@ export class MultipleChooserPanel extends InlinePanel { $(`#${opts.formsetPrefix}-OPEN_MODAL`).on('click', () => { this.chooserWidgetFactory.openModal( (result) => { - // eslint-disable-next-line no-console - console.log(result); + result.forEach((item) => { + this.addForm(); + const formIndex = this.formCount - 1; + const formPrefix = `${opts.formsetPrefix}-${formIndex}`; + const chooserFieldId = `${formPrefix}-${opts.chooserFieldName}`; + const chooserWidget = + this.chooserWidgetFactory.getById(chooserFieldId); + chooserWidget.setStateFromModalData(item); + }); }, { multiple: true }, );