Lock page scroll and enable backdrop dismissal for Package for Stores dialog#6090
Conversation
|
Thanks @Copilot for opening a Pull Request! The reviewers will test the PR and highlight if there is any conflict or changes required. If the PR is approved we will proceed to merge the pull request 🙌 |
Replace the per-dialog JavaScript scroll hacks with a single CSS rule that
rides WebAwesome's own wa-scroll-lock lifecycle. WA locks scrolling by adding
.wa-scroll-lock to <html> but only styles <body>; PWABuilder scrolls on <html>,
so its built-in lock was a no-op. Adding html.wa-scroll-lock { overflow: hidden }
makes WA's lock work for every dialog with no JS.
- Remove turnOffScroll/turnOnScroll + dom-utils.ts (added by this PR)
- Remove the older document.body.style.height hacks in sw-selector,
test-publish-pane and manifest-editor-frame (they had the same #5061 bug)
- Enable light-dismiss on all wa-dialogs and drop the preventClosing pattern
- Update packaging.spec.ts to assert the wa-scroll-lock class
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
@copilot resolve the merge conflicts in this pull request |
|
I've updated this PR so that we use light dismissal (e.g. click outside the dialog to dismiss) for all dialogs in PWABuilder. I've also simplified our scroll locking: Web Awesome uses a CSS class on the body, but it wasn't applying because scrolling on PWABuilder is applying to the |
There was a problem hiding this comment.
Pull request overview
This PR updates PWABuilder’s modal behavior to better match expected dialog UX: prevent background page scrolling while dialogs are open and allow outside-click (backdrop) dismissal where enabled. It also adds a regression test targeting the “Package for Stores” flow.
Changes:
- Add a global CSS rule to ensure WebAwesome’s scroll-lock mechanism also blocks scrolling on
<html>(PWABuilder’s scroll container). - Enable
light-dismiss(backdrop dismissal) on several<wa-dialog>instances, including the Package for Stores dialog. - Add a Playwright regression test to verify scroll locking and backdrop dismissal for the Package for Stores modal.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/pwabuilder/Frontend/tests/packaging.spec.ts | Adds regression coverage for scroll-lock + backdrop dismissal; test could be made less flaky. |
| apps/pwabuilder/Frontend/src/script/utils/dom-utils.ts | Removes prior scroll utility (file deleted in this change). |
| apps/pwabuilder/Frontend/src/script/pages/powerplatform-publish.ts | Stops forcing publish-pane to be non-dismissible; introduces a risk of leaving the page in an unusable state if the dialog is closed. |
| apps/pwabuilder/Frontend/src/script/pages/app-report.ts | Enables backdrop dismissal on additional dialogs (retest confirmation, logs, error). |
| apps/pwabuilder/Frontend/src/script/components/test-publish-pane.ts | Switches away from body-height scroll hack; enables light-dismiss. |
| apps/pwabuilder/Frontend/src/script/components/sw-selector.ts | Switches away from body-height scroll hack; enables light-dismiss. |
| apps/pwabuilder/Frontend/src/script/components/share-card.ts | Removes prevent-close logic; enables light-dismiss. |
| apps/pwabuilder/Frontend/src/script/components/publish-pane.ts | Enables light-dismiss on Package for Stores dialog and removes prevent-close wiring. |
| apps/pwabuilder/Frontend/src/script/components/publish-pane.styles.ts | Removes styling used to hide the close button in non-dismissible mode. |
| apps/pwabuilder/Frontend/src/script/components/manifest-editor-frame.ts | Removes body-height scroll hack; enables light-dismiss while preserving keyboard-close suppression in a specific tooltip scenario. |
| apps/pwabuilder/Frontend/public/global.css | Adds html.wa-scroll-lock { overflow: hidden !important; } so WA dialogs actually lock scroll in PWABuilder. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
The “Package for Stores” modal was not preventing page scroll while open, so the blurred background could still move. This also aligns the dialog with expected modal behavior by allowing backdrop clicks to dismiss it when closing is permitted.
Scroll locking
publish-paneinto the existing DOM scroll utility instead of relying on body height styling.wa-show.wa-hide.Backdrop dismissal
lightDismissfor the Package for Stores modal.preventClosingbehavior by only allowing outside-click dismissal when the dialog is allowed to close.Regression coverage