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

changes from the code do not update ui #3

Open
tb91 opened this issue Jul 23, 2019 · 2 comments
Open

changes from the code do not update ui #3

tb91 opened this issue Jul 23, 2019 · 2 comments

Comments

@tb91
Copy link

tb91 commented Jul 23, 2019

Hi,
I noticed that the Control does not update its UI if the selected value is changed by the code.
Is this intended or am I missing something?
Regards,
Tim

@tb91
Copy link
Author

tb91 commented Jul 23, 2019

Current workaround:
<SegmentedControl ref={object => { this.SegmentedControl = object; }} segments={segments} selected={this.state.commentStatus} ... />

add to the constructor:
this.SegmentedControl = undefined;

and when you want to update call:
this.SegmentedControl.onChange(1);
(make sure that it is not undefined anymore)

@chaoticbit
Copy link
Owner

Hey this is not intended. Actually when I wrote this component I had thought about it and I found that this was happening but I was moving states and just got a new job so did not get time updating it. If you have a solution for this issue then can you file a PR and I will merge it asap. @tb91

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

No branches or pull requests

2 participants