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

[DatePicker] Auto switch the view when a year is selected #5700

Merged

Conversation

donratta
Copy link

@donratta donratta commented Dec 1, 2016

  • PR has tests / docs demo, and is linted.
  • Commit and PR titles begin with [ComponentName], and are in imperative form: "[Component] Fix leaky abstraction".
  • Description explains the issue / use-case resolved, and auto-closes the related issue(s) (http://tr.im/vFqem).

This is in relation to issue #4949 (comment) where it is not intuitive to the user to click the date after selecting the year. I added a new attribute autoSwitch; where if set true changes the view back to the monthDay view where the user can now complete the date selection.

<MaterialDatePicker hintText={this.props.hintText || 'Click to select a date'}
                            hintStyle={this.props.hintStyle || styles.hint}
                            autoSwitch={true}
                            autoOk={true}/>

@oliviertassinari
Copy link
Member

oliviertassinari commented Dec 2, 2016

it is not intuitive to the user to click the date after selecting the year.

I definitely agree. The Calendar app of Google on Android is behaving like autoSwitch={true}.
It's a much better UX.

I don't think that we need to expose this new property. What about simply implementing the behavior?

@oliviertassinari oliviertassinari changed the title [DatePicker]-enhanced datepicker to autoswitch the view when a year is selected [DatePicker] Auto switch the view when a year is selected Dec 2, 2016
@oliviertassinari oliviertassinari added the component: date picker This is the name of the generic UI component, not the React module! label Dec 2, 2016
@donratta donratta force-pushed the feature/add-autoSwitch-property branch from 2342079 to cc9b217 Compare December 2, 2016 14:49
@donratta
Copy link
Author

donratta commented Dec 2, 2016

@oliviertassinari I agree also. Just wanted to provide the extra flexibility; I have edited the PR to do this implicitly now. Awesome library btw!

@oliviertassinari
Copy link
Member

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: date picker This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants