mui / material-ui-pickers

Date & Time pickers for Material UI (support from v1 to v4)
https://github.com/mui/material-ui-pickers/issues/2157
MIT License
2.32k stars 832 forks source link

DateRangePicker closes on first click when in Popover #2106

Closed BjoernRave closed 4 years ago

BjoernRave commented 4 years ago

When putting the Daterangepicker inside the Popover Component from Material-UI and trying to go back a month, the picker automatically closes on the first click no matter where.

oliviertassinari commented 4 years ago

@BjoernRave We should have solved this issue when used with core v5-alpha.

Please provide a minimal reproduction test case. This would help a lot 👷 . A live example would be perfect. This codesandbox.io template may be a good starting point. Thank you!

BjoernRave commented 4 years ago

Hey @oliviertassinari sure, here is the reproduction: https://codesandbox.io/s/agitated-vaughan-eimc8?file=/src/App.jsx

What do you exactly mean by:

We should have solved this issue when used with core v5-alpha.

That the fix for this problem will only be usable for v5 ?

oliviertassinari commented 4 years ago

@BjoernRave Thanks for the reproduction but it's not a valid combination of dependencies. The fix is only available with v5 alpha.

BjoernRave commented 4 years ago

@oliviertassinari what, how is it not a valid combination of dependencies? Because it used alpha12 of the pickers library? It was already set like that when using your template and it's the same behavior when using alpha10 which is supposed to work with v4.

Okay so that's great to hear that it's fixed in v5.

Can you maybe point me to the code where it's fixed so I can fix it with patch-package sind v5 will still take some time?

oliviertassinari commented 4 years ago

Thanks for mentioning it, the initial template I have linked needs to be updated.

KO

dependencies": {
    "@material-ui/core": "latest",
    "@material-ui/pickers": "next",

OK

dependencies": {
    "@material-ui/core": "next",
    "@material-ui/pickers": "next",
oliviertassinari commented 4 years ago

Codesandbox template updated, it will avoid future confusion like this.

oliviertassinari commented 4 years ago

Can you maybe point me to the code where it's fixed so I can fix it with patch-package sind v5 will still take some time?

Search for click away portal support.

BjoernRave commented 4 years ago

@oliviertassinari okay, thanks for the hint :)