Skip to content

Commit

Permalink
Fix for page alert pointer-events issue (#2217)
Browse files Browse the repository at this point in the history
  • Loading branch information
tylersticka committed Dec 13, 2023
1 parent 48dccda commit 0852135
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/shaggy-lemons-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@cloudfour/patterns': patch
---

Fixes issue where a page's alert container with no visible content could block pointer events toward the bottom of the viewport.
12 changes: 12 additions & 0 deletions src/objects/page/page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
* 1. Use a $factor of 0.5 to allow the alert to bleed more into the
* content margins instead of aligning with the content itself.
* 2. Match the padding-inline for visual balance.
* 3. Prevent this container from blocking interactions with content beneath
* its `z-index` layer in case the content within his hidden but not this
* containing element.
*/

.o-page__alert {
Expand All @@ -46,10 +49,19 @@
inline-size: 100%;
inset-block-end: 0;
justify-content: center;
pointer-events: none; // 3
position: fixed;
z-index: z-index.$alert;
}

/**
* Restores pointer events for any page alert content.
*/

.o-page__alert > * {
pointer-events: initial;
}

.o-page__content {
grid-row: 3;
}
Expand Down

0 comments on commit 0852135

Please sign in to comment.