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] Support focused input in open state #2002

Closed
1 task done
amok opened this issue Jul 17, 2020 · 2 comments
Closed
1 task done

[DatePicker] Support focused input in open state #2002

amok opened this issue Jul 17, 2020 · 2 comments
Labels
status: needs triage These issues haven't been looked at yet by a maintainer.

Comments

@amok
Copy link

amok commented Jul 17, 2020

I'd like to keep input focused/active when desktop calendar is open.

  • I have searched the issues of this repository and believe that this is not a duplicate.

Summary 💡

MUI-pickers version: 4.0.0-alpha.9 (see deps below)

I looked through the code, issues, API docs and did not find any proper solution.
As far as I understand DesktopWrapper has "hardcoded" role="dialog"

https://github.com/mui-org/material-ui-pickers/blob/6ffb24b2ff995658f06bebe4fda4759276e83d96/lib/src/wrappers/DesktopWrapper.tsx#L37

which makes TrapFocus of PickerPopper to enforce focused state on a Calendar element

https://github.com/mui-org/material-ui-pickers/blob/6ffb24b2ff995658f06bebe4fda4759276e83d96/lib/src/_shared/PickersPopper.tsx#L120

Examples 🌈

https://monosnap.com/file/CtU6UsH6Rl49MdJXEFrar06fxHuUbY

image

Motivation 🔦

I'm trying to achieve the following behaviour:
When input is clicked - open calendar but keep the input focused and active.
DateRangePicker already supports this behaviour, see attached video and check https://next.material-ui-pickers.dev/demo/daterangepicker#basic-usage

    "@material-ui/core": "^4.9.13",
    "@material-ui/icons": "^4.9.1",
    "@material-ui/lab": "^4.0.0-alpha.56",
    "@material-ui/pickers": "^4.0.0-alpha.9",
@amok amok added the status: needs triage These issues haven't been looked at yet by a maintainer. label Jul 17, 2020
@lamhungypl
Copy link

lamhungypl commented Jul 24, 2020

#1817 #1998.I am also waiting for this behavior.

@Serzh470
Copy link

I support this too, this behavior will be aligned with material design templates:
Desktop pickers

@oliviertassinari oliviertassinari changed the title [DesktopWrapper] Support focused input in open state [DatePicker] Support focused input in open state Dec 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage These issues haven't been looked at yet by a maintainer.
Projects
None yet
Development

No branches or pull requests

4 participants