💄(react) make Modal close button sticky
We want to make sure this button is always visible inside scrollable modals. Fixes #278
This commit is contained in:
5
.changeset/early-timers-march.md
Normal file
5
.changeset/early-timers-march.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@openfun/cunningham-react": minor
|
||||||
|
---
|
||||||
|
|
||||||
|
make Modal close button sticky
|
||||||
@@ -69,9 +69,19 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
&__close {
|
&__close {
|
||||||
position: absolute;
|
position: sticky;
|
||||||
top: 0.75rem;
|
top: 0;
|
||||||
right: 0.75rem;
|
display: flex;
|
||||||
|
justify-content: end;
|
||||||
|
z-index: 1;
|
||||||
|
height: 0;
|
||||||
|
|
||||||
|
.c__button {
|
||||||
|
right: -0.75rem;
|
||||||
|
top: -0.75rem;
|
||||||
|
position: relative;
|
||||||
|
background: var(--c--components--modal--background-color);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&__footer {
|
&__footer {
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ export const ModalInner = (props: ModalProps) => {
|
|||||||
<Button
|
<Button
|
||||||
icon={<span className="material-icons">close</span>}
|
icon={<span className="material-icons">close</span>}
|
||||||
color="tertiary-text"
|
color="tertiary-text"
|
||||||
size="nano"
|
size="small"
|
||||||
onClick={() => props.onClose()}
|
onClick={() => props.onClose()}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user