Skip to content

Commit

Permalink
fix: add boolean null state (#4583)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxPostema authored Jan 2, 2025
1 parent 1ed115f commit c9335e4
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion apps/molgenis-components/src/components/forms/InputBoolean.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
v-else
v-bind="$props"
:id="id"
:modelValue="modelValue ? 'Yes' : 'No'"
:modelValue="insertValue(modelValue)"
:options="['Yes', 'No']"
:isClearable="isClearable"
@update:modelValue="$emit('update:modelValue', returnValue($event))"
Expand All @@ -33,6 +33,15 @@ export default {
isClearable: { type: Boolean, default: true },
},
methods: {
insertValue(value) {
if (value === true) {
return "Yes";
}
if (value === false) {
return "No";
}
return null;
},
returnValue(value) {
if (value === "Yes") {
return true;
Expand Down

0 comments on commit c9335e4

Please sign in to comment.