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

SelectButton cannot have initial State #121

Closed
tsinghammer opened this issue Oct 4, 2017 · 2 comments
Closed

SelectButton cannot have initial State #121

tsinghammer opened this issue Oct 4, 2017 · 2 comments
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@tsinghammer
Copy link

Hi, I've recognized, that the SelectButton ignores props passed and only pays attention to the state when it comes to set which button is set to active state via activeIndex.
Is that on purpose?
We would like to set the index on render. If it is possible it would be even easier if we could just set a current value out of a list of available values to set the active button.

Best,
Tassilo

@MariuszKogut
Copy link
Contributor

MariuszKogut commented Oct 6, 2017

Fix for this problem:

export class SelectButton extends React.Component<any, any> {
  constructor(props: any) {
    super(props);
    this.state = {};
    // FIX
    if(props){
      this.state.activeIndex = props.activeIndex;
    }
    this.onItemClick = this.onItemClick.bind(this);
  }

@cagataycivici cagataycivici self-assigned this Oct 9, 2017
@cagataycivici cagataycivici added the Type: Bug Issue contains a defect related to a specific component. label Oct 9, 2017
@cagataycivici cagataycivici added this to the 1.0.2 milestone Oct 9, 2017
@cagataycivici
Copy link
Member

SelectButton is reimplemented and this is fixed as well;

#128

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

No branches or pull requests

3 participants