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

Controlled DatePicker, TimePicker do not update #180

Open
davidnathanael opened this issue Nov 30, 2016 · 0 comments
Open

Controlled DatePicker, TimePicker do not update #180

davidnathanael opened this issue Nov 30, 2016 · 0 comments

Comments

@davidnathanael
Copy link

davidnathanael commented Nov 30, 2016

Controlled DatePicker and TimePicker update only the first time an event is fired, then they don't change the value anymore. I have a Select input that changes the state onChange.

constructor() {
	super()
	this.state = { selectedDate: null}
}

handleProgramChange(e, program) {
	//program contains a date property
	this.setState({ selectedDate: program.date });
}

<Form>
	<FormsySelect
		name='program'
		required
		onChange={this.handleProgramChange}
	>
		{services} //MenuItems
	</FormsySelect>
	<FormsyDate
		name='date'
		value={this.state.selectedDate}
	/>
	<FormsyTime
		name='time'
		value={this.state.selectedDate}
	/>
	<RaisedButton
		label='Submit'
		type='submit'
	/>
</Form>

I don't know if this is a Formsy or Formsy material issue. I tried the material-ui TimePicker component and it works fine. Thanks

@davidnathanael davidnathanael changed the title DatePicker, TimePicker do not update Controlled DatePicker, TimePicker do not update Nov 30, 2016
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

1 participant