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

Add ability to type the date (enhancement) #3

Closed
afilp opened this issue Jun 24, 2018 · 10 comments
Closed

Add ability to type the date (enhancement) #3

afilp opened this issue Jun 24, 2018 · 10 comments

Comments

@afilp
Copy link
Contributor

afilp commented Jun 24, 2018

In an app where someone has to enter old dates (for example, a birth date at 1976), it is difficult to use just the visual modal form (too many clicks to find the date).

Could you find a way to be able to also type a date?

Please check here a similar implementation:
http://react-day-picker.js.org/docs/input

Thx!

@afilp afilp changed the title Add ability to type in the date (enhancement) Add ability to type the date (enhancement) Jun 24, 2018
@vascofg
Copy link
Owner

vascofg commented Jun 24, 2018

Please refer to Keyboard Input example here: https://material-ui-pickers.firebaseapp.com/demo/datepicker
Is this what you need? Something like:

<DateInput source="startDate" label="Start date" options={{ keyboard: true }} />

@afilp
Copy link
Contributor Author

afilp commented Jun 25, 2018

I just added the option but nothing happened, I cannot type inside the field. This is my code:

    <DateInput 
               label="Arrival Date To"
               source="startDateTo"
               options={{format: 'DD/MM/YYYY', showTodayButton: true, keyboard: true,}}
               alwaysOn
    />

@vascofg
Copy link
Owner

vascofg commented Jun 25, 2018 via email

@afilp
Copy link
Contributor Author

afilp commented Jun 25, 2018

Thx!

Not sure if we need to do something with state, as in their example they use their onChange handler. If you can show an example (maybe in the README) on how this can work, that would be great!

@vascofg
Copy link
Owner

vascofg commented Jun 25, 2018

This is fixed in the latest version, please update to 1.0.13.
I'm now using material-ui-pickers default TextFieldComponent which has the logic to handle these different modes.

@afilp
Copy link
Contributor Author

afilp commented Jun 25, 2018

Seems to be fixed indeed. Thanks!

P.S. It has some weird behavior though, when pressing ENTER. It fetches twice, once when it loses the focus and another time when clicking OK in the modal that just opened.

@vascofg
Copy link
Owner

vascofg commented Jun 25, 2018

Not sure, does passing disableOpenOnEnter on options help with that?

@vascofg
Copy link
Owner

vascofg commented Jul 5, 2018

Please check mui/material-ui-pickers#495 for another possible issue.

@vascofg vascofg closed this as completed Jul 5, 2018
@afilp
Copy link
Contributor Author

afilp commented Jul 9, 2018

@vascofg Thanks! Will you merge their latest master to get the fix here too?

@vascofg
Copy link
Owner

vascofg commented Jul 9, 2018

I've bumped the material-ui-pickers dependency version in 1.0.16, please confirm this is fixed.

@vascofg vascofg reopened this Jul 9, 2018
@vascofg vascofg closed this as completed Jul 18, 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