Skip to content

Commit

Permalink
Don't allow empty selection on required select field
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed Sep 28, 2023
1 parent fc7e0a7 commit ac3cd58
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions client/src/components/Form/Elements/FormSelect.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ describe("FormSelect", () => {

it("multiple values", async () => {
const wrapper = createTarget({
optional: true,
multiple: true,
options: defaultOptions,
value: ["value_1", "", 99],
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Form/Elements/FormSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ onMounted(() => {
<multiselect
v-if="hasOptions"
v-model="currentValue"
:allow-empty="true"
:allow-empty="optional"
:class="['form-select', cls]"
:close-on-select="!multiple"
:deselect-label="deselectLabel"
Expand Down

0 comments on commit ac3cd58

Please sign in to comment.