Skip to content
This repository was archived by the owner on Aug 23, 2022. It is now read-only.
This repository was archived by the owner on Aug 23, 2022. It is now read-only.

Inconsistent behavior between native and custom controls with boolean-valued radio buttons #779

@tmcdonnell87

Description

@tmcdonnell87

The Problem

When using native controls, it is possible to create a boolean-valued radio button, such as:

       <Control.radio
          model=".choice"
          value={false}
          required
        />

However, when you create the same button and pass in a component, the boolean value is translated to a string, and thus doesn't allow the button to be clicked.

        import Radio from 'react-bootstrap/lib/Radio';
        <Control.radio
          component={Radio}
          model=".choice"
          value={false}
          required
        >Boolean false</Control.radio>

Steps to Reproduce

See reproduced example. Note that, in the top section, clicking the Boolean true option does nothing, and the Boolean false option matches the String false option. In the bottom section, all radio buttons work as expected.

Expected Behavior

Radio button behavior is consistent even when using custom controls.

Actual Behavior

Boolean values are converted to strings in state, and thus do not match the control value.

Reproducible Code Example

https://esnextb.in/?gist=98695ff117787fcdc4a3a10245cd0582

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions