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] Add keyboard support to inline mode #4945

Closed
wants to merge 23 commits into from

Conversation

caesay
Copy link

@caesay caesay commented Aug 10, 2016

  • PR has tests / docs demo, and is linted.

When container=inline and keyboardEnabled=true on a datepicker component, this enables keyboard support. You can tab in, type a date, tab out. Also, clicking directly on the control also focuses the textbox.

I'm re-using the date state variable for the current textbox value as well as the stored date object, if this needs to be changed let me know how you would like it to be implemented instead.

Issue #4219 should likely also be looked at in this pull request to ensure that the popup calendar doesn't hide the textbox while it has focus. (fixed with b3ed601)

Closes mui/mui-x#6232

@muibot muibot added PR: Needs Review PR: needs revision The pull request can't be merged. More details is available on the code review or fails in the CI and removed PR: Needs Review labels Aug 10, 2016
@aahan96
Copy link
Contributor

aahan96 commented Aug 11, 2016

@caesay Nice PR! I just had one issue. When we change the date through keyboard and hit enter key, it changes back to the previous date and doesn't save the new date. Is there any way you could handle that?

@caesay
Copy link
Author

caesay commented Aug 11, 2016

@aahan96 I've added a commit which handles the enter key.

hintText="Keyboard Enabled Dialog"
container="inline"
mode="landscape"
keyboardEnabled={true}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have seen other places in the code where props like these are alphabetically sorted. Is that a convention? Should it be done here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nicolaiskogheim propType declarations are definitely alphabetical. I don't know about prop assignments, but either way this is just the docs file and the previous examples don't follow this rule either.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: needs revision The pull request can't be merged. More details is available on the code review or fails in the CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DatePicker] Use keyboard to write date
4 participants