vaadin / hilla

Build better business applications, faster. No more juggling REST endpoints or deciphering GraphQL queries. Hilla seamlessly connects Spring Boot and React to accelerate application development.
https://hilla.dev
Apache License 2.0
895 stars 56 forks source link

RadioGroup not working with boolean value #2073

Open ilyasdotdev opened 6 months ago

ilyasdotdev commented 6 months ago

Describe the bug

const {field, model, read} = useForm(MyModel);
 <VerticalLayout style={{ alignItems: 'stretch', width: '18rem', maxWidth: '100%' }}>
                    <TextField label="Title" {...field(model.title)} />
                    <NumberField label="Order" {...field(model.order)} />
                    <RadioGroup label="Status" {...field(model.isEnabled)} >
                        <RadioButton value="true" label="Enable" />
                        <RadioButton value="false" label="Disabled" />
                    </RadioGroup>
                </VerticalLayout>

on calling read(model) getting error on browser The radio button with the value "true" was not found.

`

Expected-behavior

No response

Reproduction

const {field, model, read} = useForm(MyModel); <VerticalLayout style={{ alignItems: 'stretch', width: '18rem', maxWidth: '100%' }}> <TextField label="Title" {...field(model.title)} /> <NumberField label="Order" {...field(model.order)} /> <RadioGroup label="Status" {...field(model.isEnabled)} >

                    <RadioButton value="false" label="Disabled" />
                </RadioGroup>
            </VerticalLayout>

System Info

Chrome browser

platosha commented 6 months ago

Thanks. This is maybe related: https://github.com/vaadin/hilla/issues/177

ilyasdotdev commented 6 months ago

Thanks. This is maybe related: https://github.com/vaadin/hilla/issues/177

It has not been fixed since 2 years?