-
Notifications
You must be signed in to change notification settings - Fork 77
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
fix(modal)!: use fixed positioning on host to prevent Safari from clipping content in certain layouts #9545
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,10 @@ | |
|
||
:host { | ||
--calcite-modal-scrim-background: #{rgba($calcite-color-neutral-blk-240, $calcite-opacity-85)}; | ||
@apply absolute flex inset-0 opacity-0 z-overlay; | ||
} | ||
|
||
:host { | ||
@apply fixed flex inset-0 opacity-0 z-overlay; | ||
visibility: hidden !important; | ||
transition: | ||
visibility 0ms linear var(--calcite-internal-animation-timing-slow), | ||
|
@@ -29,14 +32,13 @@ | |
|
||
.container { | ||
@apply text-color-2 | ||
fixed | ||
absolute | ||
inset-0 | ||
flex | ||
items-center | ||
justify-center | ||
overflow-y-hidden | ||
opacity-0 | ||
z-overlay; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we confirm this overlay isn't needed in some complex slot / stack situations? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The overlay z-index is already applied on the host, so modals should already be on that layer. Do you have any examples of complex stacking we could use for testing? |
||
opacity-0; | ||
visibility: hidden !important; | ||
transition: | ||
visibility 0ms linear var(--calcite-internal-animation-timing-slow), | ||
|
@@ -66,7 +68,7 @@ | |
|
||
.scrim { | ||
--calcite-scrim-background: var(--calcite-modal-scrim-background, var(--calcite-color-transparent-scrim)); | ||
@apply fixed inset-0 flex overflow-y-hidden; | ||
@apply absolute inset-0 flex overflow-y-hidden; | ||
} | ||
|
||
.modal { | ||
|
@@ -165,7 +167,6 @@ | |
padding-inline: var(--calcite-modal-padding-internal); | ||
flex: 0 0 auto; | ||
calcite-icon { | ||
@apply pointer-events-none; | ||
vertical-align: -2px; | ||
} | ||
&:focus { | ||
|
@@ -402,16 +403,4 @@ slot[name="primary"] { | |
} | ||
} | ||
|
||
/** | ||
* Conditional styles for when Modal is slotted in Shell | ||
*/ | ||
|
||
.container--embedded { | ||
position: absolute; | ||
pointer-events: auto; | ||
calcite-scrim { | ||
position: absolute; | ||
} | ||
} | ||
|
||
@include base-component(); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -141,4 +141,8 @@ slot[name="panel-top"]::slotted(calcite-shell-center-row) { | |
inset: 0; | ||
} | ||
|
||
slot[name="modals"]::slotted(calcite-modal) { | ||
position: absolute; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there any way to confirm we don't need the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
} | ||
|
||
@include base-component(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would we need to do this for the dialog component as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're going to test drive this with
modal
first. If everything works out smoothly, we could apply to other components before 4.0 since it wouldn't be breaking (see #9545 (comment)).