-
Notifications
You must be signed in to change notification settings - Fork 85
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
Date picker unexpectedly appears above dialog overlay #6788
Comments
Hi @Chris3y - can I ask what the use case of this is, as I'd like to get @harpalsingh's opinion on it as it seems a bit weird from a UX perspective? From a Carbon Developer perspective it will create some issues if we're messing around with contextual z-index's like that and we could introduce further "whack-a-mole" situations. If there's a valid use case, we will certainly look into what we can do, but it feels like a bit of an edge case beyond the scope of the date picker component on the surface. |
Hello, So the business requirement for this is: We need away of controlling the datepicker popup or control the z index to appear behind the overlay of the dialog. |
Would like to bring @tempertemper into this conversation, as it seems opening a dialog from a date input blur? presents a variety of issues, in particular around accessbility and do we inform the user of this flow? I feel we should review the use case of this before we determine the z-index issue itself as that could have many knock on issues, |
Would it be possible to give us manual control over the opening and closing of the datepicker popup? That way, we could manage this ourselves. |
@harpalsingh , @ljemmo. How do you guys feel about exposing an |
From a product point of view , the addition of an |
@nicktitchmarsh fine from my perspective. |
As this state is managed internally I think adding the ability to control the open state will lead to a few issues, such as knowing when a blur of the input was caused by a user tabbing to the picker element to select a date. I think it will be better to surface a callback that will be called when the user blurs the input and the picker is closed. I've made a very rough example in this branch, the last commit has the callback I've mentioned above but I also added a commit before that adding the ability to control so if you interactively rebase to it. Both examples can be seen via running storybook and testing the default date story which has been updated to replicate the above stackblitz |
This sounds more like a dev implementation issue from my end. Happy to go with @edleeks87's approach if thats industry norm here. |
FE-6761 |
From an accessibility stand point, we would want the date picker to close when the dialog is opened; after leaving the dialog the date field should be refocused and the date picker opened again. But this would presumably force the user to open the Dialog again when the field is blurred? As a side note this sounds like a less than ideal user experience to have their intended action (tabbing fields) be interrupted by an unexpected Dialog. Would it be possible to rethink how this interaction works? Perhaps an edit all rows button that launches the dialog instead? |
### [142.13.2](v142.13.1...v142.13.2) (2024-10-04) ### Bug Fixes * **date:** add callback to be called when component blurs and picker is closed ([2a7e50e](2a7e50e)), closes [#6788](#6788)
🎉 This issue has been resolved in version 142.13.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
The datepicker has a higher z-index than the dialog overlay (probably to ensure dates inside dialog always show) but causes the unexpected behavior in this situation. I.e. The date picker is above the darkened overlay.
Reproduction
https://stackblitz.com/edit/parsium-carbon-starter-ejsyyt?file=src%2FApp.tsx
Steps to reproduce
In sandbox,
JIRA ticket numbers (Sage only)
No response
Suggested solution
No response
Carbon version
latest
Design tokens version
No response
Relevant browsers
Chrome
Relevant OSs
Windows
Additional context
No response
Confidentiality
The text was updated successfully, but these errors were encountered: