Close dropdown after selection with multiselect

This conforms with the previous select2 multiselect behaviour
This commit is contained in:
Matt-Yorkley
2023-05-10 12:49:11 +01:00
parent c3cf79f5ef
commit 310577c49d

View File

@@ -8,6 +8,7 @@ export default class extends Controller {
maxOptions: null,
plugins: ["dropdown_input"],
allowEmptyOption: true,
closeAfterSelect: true,
onItemAdd: function () {
this.setTextboxValue("");
},
@@ -34,7 +35,6 @@ export default class extends Controller {
#placeholder() {
const optionsArray = [...this.element.options];
return optionsArray.find((option) => [null, ""].includes(option.value))
?.text;
return optionsArray.find((option) => [null, ""].includes(option.value))?.text;
}
}