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] There is no show() method for the <DatePicker/> component #7292

Closed
ghost opened this issue Jul 15, 2015 · 5 comments
Closed

[DatePicker] There is no show() method for the <DatePicker/> component #7292

ghost opened this issue Jul 15, 2015 · 5 comments
Labels
component: pickers This is the name of the generic UI component, not the React module!

Comments

@ghost
Copy link

ghost commented Jul 15, 2015

The component currently does not have a method to toggle show/hide. The picker is only accessible by pressing on a textfield that the component automatically renders. I did notice that there is a date-picker-dialog component in the code but it has not been exposed yet outside of the framework. Making the dialog available would greatly improve the flexibility of the date picker API I think. Any thoughts?

@oliviertassinari
Copy link
Member

You can use the ref dialogWindow.

@ghost
Copy link

ghost commented Jul 15, 2015

This works but feels like a bit of a hacky solution. I don't understand why the date-picker component is linked to a Textfield by default. Exposing the date-picker-dialog component is a better solution in my opinion.

@hai-cea hai-cea changed the title There is no show() method for the <DatePicker/> component [DatePicker] There is no show() method for the <DatePicker/> component Jul 16, 2015
@shaurya947
Copy link

@gappture see the table docs, we now have an openDialog() function that can be called on the DatePicker component.

@carpben
Copy link

carpben commented Dec 12, 2017

I just checked the table docs in the link above - I found nothing about an openDialog function.

@cmackay
Copy link

cmackay commented Dec 15, 2017

I was just looking for the same openDialog function and it looks like you can get access to it from the ref.

  <Button label="show date picker" onClick={e => this.datePickerRef.openDialog()} />
  <DatePicker ref={ref => this.datePickerRef = ref} />

@zannager zannager added the component: pickers This is the name of the generic UI component, not the React module! label Dec 21, 2022
@zannager zannager transferred this issue from mui/material-ui Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: pickers This is the name of the generic UI component, not the React module!
Projects
None yet
Development

No branches or pull requests

6 participants