-
-
Notifications
You must be signed in to change notification settings - Fork 79.2k
Add Dialog component using native HTML5 dialog element and scrollbar-gutter #41751
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
Draft
Copilot
wants to merge
18
commits into
v6-dev
Choose a base branch
from
copilot/fix-cdf3e24a-3313-42be-a73c-fe34d2b3b1c7
base: v6-dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Don't disallow calc() * Remove disables that aren't needed * Remove custom subtract and add functions * Remove more disables * keep it here
* Convert .ratio helper to new .ratio utility * Fix up * Fix links for now, even though they'll be deleted
* Drop clearfix for display: flow-root * Fix links
* Remove all deprecated Sass variables and deprecation notices from docs components * Fix linter error * fix
* Remove added badges from docs pages * Remove AddedIn
…s and extra dependencies once we migrate to Sass modules (#41697)
* Reorganize scss folder * Migrate to Sass modules * Migrate docs to Sass modules, comment out docs grid CSS * Give helpers folder an index.scss, migrate ratio helper to aspect-ratio utility * Delete node sass Action * Modify Sass tests to pass for new Sass modules implementation * Don't disallow calc() * Move heading classes back to Reboot to prevent a dependency * Utilities, some helpers, and theme colors * Temporary fix of docs compilation * Temporary Bundlewatch fix * docs fix import to use * Restyle docs callouts * Fix docs colors * Revert typo * Reintroduce `css-lint-vars` npm script * Bump to Sass v1.90.x * Fixes * more * Remove --------- Co-authored-by: Julien Déramond <[email protected]>
* First pass at CSS layers * bundlewatch * more bundlewatch
…41702) * Restore both grids and update mixins * Bundlewatch
* Co-locate Sass variables in most files * another * fix * Don't bring tables into reboot, temp remove some sass vars so we don't need the co-dependency * Move vars * bundlewatch * scssdocs * Fix scssdocs
…utter Co-authored-by: mdo <[email protected]>
Copilot stopped work on behalf of
mdo due to an error
September 18, 2025 03:27
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces a new Dialog component that serves as a modern replacement for the Modal component, leveraging native HTML5
<dialog>
elements and modern CSS properties for improved performance and accessibility.Key Features
Native HTML5 Dialog Element
The new Dialog component uses the semantic
<dialog>
element instead of plain HTML divs, providing:Modern CSS with scrollbar-gutter
Replaces manual scrollbar width detection with the
scrollbar-gutter: stable
CSS property:Modal and Non-Modal Support
The Dialog component supports both interaction modes through a new
modal
option:dialog.showModal()
to block page interactiondialog.show()
to allow background interactionImplementation
JavaScript Component (
js/src/dialog.js
)backdrop
,focus
,keyboard
modal
option to control dialog behaviorshowModal()
,show()
,close()
)CSS Styles (
scss/_dialog.scss
)scrollbar-gutter
for consistent scrollbar handlingdialog-backdrop
classComprehensive Testing
Usage Examples
Basic Modal Dialog
Non-Modal Dialog
Browser Support
The Dialog component leverages the native
<dialog>
element which is supported in all modern browsers. Thescrollbar-gutter
property provides progressive enhancement with fallback behavior.Migration Path
The Dialog component maintains API compatibility with the existing Modal component, making it easy to adopt as a drop-in replacement while gaining the benefits of native dialog functionality.
The screenshot shows the Dialog component in action, demonstrating the modal dialog with backdrop and proper styling using the native HTML5
<dialog>
element.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
accounts.google.com
/opt/google/chrome/chrome --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=3795 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-80321160 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,2107222210045699955,1609544903048714745,262144 --disable-features=PaintHolding --variations-seed-version
(dns block)/opt/google/chrome/chrome --user-data-dir=/tmp/karma-80321160 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 --noerrdialogs --ozone-platform=headless --ozone-override-screen-size=800,600 --use-angle=swiftshader-webgl http://localhost:9876/?id=80321160
(dns block)/opt/google/chrome/chrome --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=4100 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-15075696 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,17951303586872664960,10623212525715332264,262144 --disable-features=PaintHolding --variations-seed-version
(dns block)android.clients.google.com
/opt/google/chrome/chrome --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=3795 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-80321160 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,2107222210045699955,1609544903048714745,262144 --disable-features=PaintHolding --variations-seed-version
(dns block)/opt/google/chrome/chrome --user-data-dir=/tmp/karma-80321160 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 --noerrdialogs --ozone-platform=headless --ozone-override-screen-size=800,600 --use-angle=swiftshader-webgl http://localhost:9876/?id=80321160
(dns block)/opt/google/chrome/chrome --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=4100 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-15075696 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,17951303586872664960,10623212525715332264,262144 --disable-features=PaintHolding --variations-seed-version
(dns block)clients2.google.com
/opt/google/chrome/chrome --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=3795 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-80321160 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,2107222210045699955,1609544903048714745,262144 --disable-features=PaintHolding --variations-seed-version
(dns block)/opt/google/chrome/chrome --user-data-dir=/tmp/karma-80321160 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 --noerrdialogs --ozone-platform=headless --ozone-override-screen-size=800,600 --use-angle=swiftshader-webgl http://localhost:9876/?id=80321160
(dns block)/opt/google/chrome/chrome --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=4100 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-15075696 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,17951303586872664960,10623212525715332264,262144 --disable-features=PaintHolding --variations-seed-version
(dns block)clientservices.googleapis.com
/opt/google/chrome/chrome --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=3795 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-80321160 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,2107222210045699955,1609544903048714745,262144 --disable-features=PaintHolding --variations-seed-version
(dns block)/opt/google/chrome/chrome --user-data-dir=/tmp/karma-80321160 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 --noerrdialogs --ozone-platform=headless --ozone-override-screen-size=800,600 --use-angle=swiftshader-webgl http://localhost:9876/?id=80321160
(dns block)/opt/google/chrome/chrome --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=4100 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-15075696 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,17951303586872664960,10623212525715332264,262144 --disable-features=PaintHolding --variations-seed-version
(dns block)optimizationguide-pa.googleapis.com
/opt/google/chrome/chrome --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=3795 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-80321160 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,2107222210045699955,1609544903048714745,262144 --disable-features=PaintHolding --variations-seed-version
(dns block)/opt/google/chrome/chrome --user-data-dir=/tmp/karma-80321160 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 --noerrdialogs --ozone-platform=headless --ozone-override-screen-size=800,600 --use-angle=swiftshader-webgl http://localhost:9876/?id=80321160
(dns block)/opt/google/chrome/chrome --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=4100 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-15075696 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,17951303586872664960,10623212525715332264,262144 --disable-features=PaintHolding --variations-seed-version
(dns block)redirector.gvt1.com
/opt/google/chrome/chrome --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=3795 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-80321160 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,2107222210045699955,1609544903048714745,262144 --disable-features=PaintHolding --variations-seed-version
(dns block)/opt/google/chrome/chrome --user-data-dir=/tmp/karma-80321160 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 --noerrdialogs --ozone-platform=headless --ozone-override-screen-size=800,600 --use-angle=swiftshader-webgl http://localhost:9876/?id=80321160
(dns block)/opt/google/chrome/chrome --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=4100 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-15075696 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,17951303586872664960,10623212525715332264,262144 --disable-features=PaintHolding --variations-seed-version
(dns block)safebrowsingohttpgateway.googleapis.com
/opt/google/chrome/chrome --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=3795 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-80321160 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,2107222210045699955,1609544903048714745,262144 --disable-features=PaintHolding --variations-seed-version
(dns block)/opt/google/chrome/chrome --user-data-dir=/tmp/karma-80321160 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 --noerrdialogs --ozone-platform=headless --ozone-override-screen-size=800,600 --use-angle=swiftshader-webgl http://localhost:9876/?id=80321160
(dns block)/opt/google/chrome/chrome --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=4100 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-15075696 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,17951303586872664960,10623212525715332264,262144 --disable-features=PaintHolding --variations-seed-version
(dns block)www.google.com
/opt/google/chrome/chrome --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=3795 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-80321160 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,2107222210045699955,1609544903048714745,262144 --disable-features=PaintHolding --variations-seed-version
(dns block)/opt/google/chrome/chrome --user-data-dir=/tmp/karma-80321160 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 --noerrdialogs --ozone-platform=headless --ozone-override-screen-size=800,600 --use-angle=swiftshader-webgl http://localhost:9876/?id=80321160
(dns block)/opt/google/chrome/chrome --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=4100 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-15075696 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,17951303586872664960,10623212525715332264,262144 --disable-features=PaintHolding --variations-seed-version
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.