Skip to content

Commit

Permalink
FIO-5003: fixed that the radio with the value "false" is not displaye…
Browse files Browse the repository at this point in the history
…d in different templates (formio#4699)
  • Loading branch information
AlexanderLihodievskiy authored May 17, 2022
1 parent dd395d0 commit 8812a7f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/radio/Radio.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,16 @@ export default class RadioComponent extends Field {
}

getValueAsString(value) {
if (!value) {
return '';
}
if (!_.isString(value)) {
value = _.toString(value);
}

const option = _.find(this.component.values, (v) => v.value === value);

if (!value) {
return _.get(option, 'label', '');
}

return _.get(option, 'label', '');
}

Expand Down

0 comments on commit 8812a7f

Please sign in to comment.