mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Close dropdown after selection with multiselect
This conforms with the previous select2 multiselect behaviour
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user