Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AXARadio with React - the component behaves as "uncontrolled" #793

Closed
1 of 2 tasks
marek99999 opened this issue Jan 23, 2019 · 2 comments
Closed
1 of 2 tasks

AXARadio with React - the component behaves as "uncontrolled" #793

marek99999 opened this issue Jan 23, 2019 · 2 comments

Comments

@marek99999
Copy link

Are you reporting a bug or a feature?

  • Bug
  • Feature

Expected Behavior

When using AXARadio with React, the component behaves as "uncontrolled", although it is set as "controlled" by the code. E.g. the user can "check" the radio button, although its "checked" props is set to false.

E.g. in the simplified code bellow, the option"b" should be selected and user should be unable to select option "a". However, the user is able to select option "a".
...
const AXARadioReact = withReact(AXARadio);
...
this.state = {
radio: 'b'
}
...
handleRadioChange = (event) => { //intentionally empty
}
....
<AXARadioReact
value="a"
name="name1"
onChange={this.handleRadioChange}
checked={this.state.radio === 'a'}
>
a

<AXARadioReact
value="b"
name="name1"
onChange={this.handleRadioChange}
checked={this.state.radio === 'b'}
>
b

.....

Currently is the user can "check" the radio button, although its "checked" props is set to "false"

Steps to Reproduce the Problem

(see code snips above)

  1. Create a AXARadio with React
  2. Place multiple AxaRadioReact buttons into a component (with the same name)
  3. Set their checked props e.g. to "false"
  4. Run the react application and try to switch between the options of radio buttons (it should not be possible, but it is)

Specifications

Please provide any relevant information about your setup - os, browser, node, npm, etc. -->

  • Browser: Chrome
  • Browser Version: Version 71.0.3578.98 (Official Build) (64-bit)
  • Platform: Windows

Failure Logs

@AndyOGo
Copy link

AndyOGo commented Jan 23, 2019

Thank you very much.
Unfortunately React's controlled inputs aren't support right now.
Same issue here #439

@LucaMele
Copy link
Contributor

Closing as V2 is released. If issue is still relevant in v2, please re-open

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants