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

Timepicker automatically close when update state inside onTimeChange event. #88

Closed
umair-khanzada opened this issue Jul 11, 2018 · 2 comments

Comments

@umair-khanzada
Copy link

umair-khanzada commented Jul 11, 2018

Picker automatically close when I update state inside onTimeChange if I comment setState() it is not update time, below is my code please have a look.

JS:

//default state.
this.state = {start: {time: '11:01', meridiem: 'AM'}};

onTimeChange({hour, minute, meridiem}) {
    console.log("hour", hour)
    console.log("minute", minute)
    console.log("meridiem", meridiem)
    this.setState({start: {time: `${hour}:${minute}`, meridiem}})
  }

JSX:

<TimePicker timeMode="12" 
  time={this.state.start.time} meridiem={this.state.start.meridiem}  
  closeOnOutsideClick={false} onTimeChange={this.onTimeChange.bind(this)} />
@umair-khanzada umair-khanzada changed the title Timepicker automatically close when onTimeChange event fire. Timepicker automatically close when update state inside onTimeChange event. Jul 11, 2018
@ecmadao
Copy link
Owner

ecmadao commented Jul 12, 2018

@umair-khanzada
Thanks for feedback! Yes there seems had a small mistake for focused state update, and I have just published v3.1.4 to fix it.

@umair-khanzada
Copy link
Author

@ecmadao
Thanks 👍

@ecmadao ecmadao closed this as completed Jul 13, 2018
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