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

Datepickerinput should close when disabled #7006

Closed
1 of 2 tasks
MathRobin opened this issue Oct 21, 2024 · 1 comment · Fixed by #7017
Closed
1 of 2 tasks

Datepickerinput should close when disabled #7006

MathRobin opened this issue Oct 21, 2024 · 1 comment · Fixed by #7017

Comments

@MathRobin
Copy link

MathRobin commented Oct 21, 2024

Dependencies check up

  • I have verified that I use latest version of all @mantine/* packages

What version of @mantine/* packages do you have in package.json?

7.13.3

What package has an issue?

@mantine/dates

What framework do you use?

Other, I will specify in the bug description

In which browsers you can reproduce the issue?

All

Describe the bug

I can reproduce this on Chrome and Firefox on Ubuntu, not able to try on Windows/Mac or with others browsers but think it's not related.

When a DatePickerInput popover is opened, if you disabled it without selecting any date or without closing it manually. The popover stays opened and continue to allow selecting of date.

Better is to show you a sample (sorry, text in the UI is in french). In this video I enabled the datepickerinput, see popover open at click. Juste after i selected another option by radio. And my UI needs to disable the datepicker (choosing a date relative option). But my popover stayed opened and I could change the date. Not desired behaviour.

Capture.video.du.2024-10-21.15-09-39.webm

If possible, include a link to a codesandbox with a minimal reproduction

You can reproduce directly on the docs by disabling the picker when popover is opened
https://mantine.dev/dates/date-time-picker/#input-props

Possible fix

When switching to disabled, popover should close. I'm not able to fix it alone, but what i was able to understand, the datepickerinput is based on a generic pickerinputbase in matine/dates package. Which can mean that the other pickers in popover, at least, have the same behaviour/bug.

Self-service

  • I would be willing to implement a fix for this issue

Many ❤️ on you for this great project !

@MathRobin
Copy link
Author

Many thanks ! Have a nice day !

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

Successfully merging a pull request may close this issue.

1 participant