Skip to content

Commit 5b6a80f

Browse files
committed
fix setting value
1 parent 56a3de7 commit 5b6a80f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/bundle/Resources/public/ts/components/dropdown/dropdown_multi_input.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export class DropdownMultiInput extends BaseDropdown {
1616
const _sourceInputNode = this._sourceNode.querySelector<HTMLSelectElement>('select');
1717

1818
if (!_sourceInputNode) {
19-
throw new Error('DropdownSingleInput: Required elements are missing in the container.');
19+
throw new Error('DropdownMultiInput: Required elements are missing in the container.');
2020
}
2121

2222
this._sourceInputNode = _sourceInputNode;
@@ -51,7 +51,7 @@ export class DropdownMultiInput extends BaseDropdown {
5151
this._sourceInputNode.appendChild(option);
5252
});
5353

54-
this.setValue(this._sourceInputNode.value);
54+
this.setValues(this.getSelectedValuesFromSource());
5555
}
5656

5757
protected setSourceValue(id: string, actionPerformed: DropdownMultiInputAction) {
@@ -108,7 +108,11 @@ export class DropdownMultiInput extends BaseDropdown {
108108

109109
this._value = [];
110110

111-
tempValue.forEach((value) => {
111+
this.setValues(tempValue);
112+
}
113+
114+
public setValues(values: string[]) {
115+
values.forEach((value) => {
112116
this.setValue(value);
113117
});
114118
}

0 commit comments

Comments
 (0)