Description
Context
An initial exploration and delivery of a Dialog
component was done a while ago:
This experimental work was never exported or shown in storybook but still lives in the codebase. Most of the spec of that work stream was focused on managing focus and handling interactions such as escape closing the dialog.
The current state
Since then, there has been some progress on the native dialog element spec and much of this focus and interaction behavior is now provided natively by browsers.
- https://www.scottohara.me/blog/2023/01/26/use-the-dialog-element.html
- https://www.youtube.com/watch?v=ywtkJkxJsdg
- https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog
- https://www.makethingsaccessible.com/guides/modal-vs-non-modal-dialogs
Proposal
This issue is to propose considering using the native dialog element in place of the existing implementation that uses the FocusScope
primitive.
Depending on what we consider to be "must have" functionality of a Dialog
, it might be that the bulk of the requirements might be met by the dialog
element. It might be a simple wrapper around that element is all we need.
Pieces solved in #15926
- Evaluate the interaction provided via the native element
- Compare the native implementation to the one we have in the codebase today
- Determine what we may need to provide to consumers in addition to what is provided by default by the browser implementation
- Potentially refactor the implementation to not manage focus via the FocusScope helpers (potentially remove these helpers if they're not being used)
Outstanding items that still need to be made into sub-issues
- Add Dialog and associated refactors/usages/etc. to
@carbon/web-components
- Move to stable , work through stable checklist (code, website docs, etc.)
- ...
Sub-issues
Metadata
Metadata
Assignees
Labels
Type
Projects
Status