Muetze42 / nova-radio-field

A Radio Buttons field for Laravel Nova.
https://novapackages.com/packages/norman-huth/nova-radio-field
MIT License
5 stars 2 forks source link

true, false values for form view are not displayed correctly #32

Open Rick-Blanksma opened 1 month ago

Rick-Blanksma commented 1 month ago

Describe the bug On line 89 of the FormField.vue file there is a if(!this.selectedOption) check. This does not accept 0 int values (so false). This means that you can't have true, false radio options like Radio::make()->options([true => 'something', false = 'something else']). A fix for this would be:

if (this.selectedOption === null || this.selectedOption === undefined) { this.selectedOption = firstValue; }

Or even shorter: this.selectedOption ??= firstValue;

In the index page you see: image

Current situation: image

Expected situation: image