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

[Feature Request]: Date picker should not open on focus (or make it optional) #9865

Open
1 task done
grahamharper opened this issue Oct 14, 2021 · 8 comments
Open
1 task done
Labels
proposal: accepted This request has gone through triaging and we are accepting PR's against it. role: dev 🤖 type: a11y ♿ type: enhancement 💡 version: 11 Issues pertaining to Carbon v11

Comments

@grahamharper
Copy link

Summary

Currently, DatePicker opens on focus. Change the behaviour of DatePicker so it does not open on focus but instead only opens when the user interacts with it, either by clicking on the field with the mouse or pressing the down-arrow while the field is focussed.

If this can't/shouldn't be the default then make it optional e.g. a focusOpens prop that when set to false behaves as I've described.

Justification

When the date picker input field is the first field in a modal dialog it is focussed automatically (as per web authoring standards) when the modal opens and thus the picker opens also, which is unexpected, annoying, distracting and can obscure some of the content of the modal.

Also, when tabbing through a large form, such as when skipping over optional fields, or navigating to a field to correct an error, if the user tabs through one or several date picker fields, this is annoying and distracting, adding cognitive load.

Desired UX and success metrics

  • User satisfaction
  • Form completion time/error rate

Required functionality

Change the behaviour of DatePicker so it does not open on focus but instead only opens when the user interacts with it, either by clicking on the field with the mouse or pressing the down-arrow while the field is focussed.

Specific timeline issues / requests

No response

Available extra resources

Front-end developers

Code of Conduct

@jnm2377 jnm2377 added proposal: open This request has gone through triaging. We're determining whether we take this on or not. and removed status: needs triage 🕵️‍♀️ labels Oct 20, 2021
@theiliad theiliad added proposal: needs more research 🕵️‍♀️ proposal: accepted This request has gone through triaging and we are accepting PR's against it. and removed proposal: open This request has gone through triaging. We're determining whether we take this on or not. labels Dec 6, 2021
@grahamharper
Copy link
Author

@theiliad any updates on when this might be addressed or suggestions of how we can address on our side?

@grahamharper
Copy link
Author

I've opened an issue to propose this change on the flatpickr library too flatpickr/flatpickr#2703

@grahamharper
Copy link
Author

We've opened a PR on the flatpickr repo to address this: flatpickr/flatpickr#2707

@strongui
Copy link

This is also necessary to help with accessibility. Focus open should really be optional.

@guidari guidari added role: dev 🤖 version: 11 Issues pertaining to Carbon v11 labels Jan 10, 2024
@OleksandrDzindziura
Copy link

Hey! Any updates about it?

@ddtbuilder
Copy link

any updates? spending way too much time trying to prevent focus and subsequent opening

@strongui
Copy link

strongui commented Sep 5, 2024

@ddtbuilder Don't bother waiting for this. I don't know if the dev of this is dead or what, but a simple patch package will do the trick. Just change these lines: flatpickr/flatpickr#2703 (comment) like addressed here and it will fix the issue. npx patch-package flatpickr and off you go.

@ddtbuilder
Copy link

@ddtbuilder Don't bother waiting for this. I don't know if the dev of this is dead or what, but a simple patch package will do the trick. Just change these lines: flatpickr/flatpickr#2703 (comment) like addressed here and it will fix the issue. npx patch-package flatpickr and off you go.

awesome, thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal: accepted This request has gone through triaging and we are accepting PR's against it. role: dev 🤖 type: a11y ♿ type: enhancement 💡 version: 11 Issues pertaining to Carbon v11
Projects
Status: Later 🧊
Development

No branches or pull requests

7 participants