Skip to content

Commit

Permalink
fix: add class on mount and fix backdrop
Browse files Browse the repository at this point in the history
  • Loading branch information
jowjow22 committed Sep 27, 2024
1 parent 5cf8c32 commit fa5b319
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/core/src/components/modal/modal.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
@import '~@atomium/scss-utils/index';

.atom-modal {
position: fixed;

&__close {
position: absolute;
right: var(--spacing-small);
Expand Down
4 changes: 3 additions & 1 deletion packages/core/src/components/modal/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export class AtomModal {
@Prop() hasFooter = true
@Prop() disablePrimary = false
@Prop() disableSecondary = false
@Prop() isOpen = false

@Event() atomCloseClick: EventEmitter
@Event() atomDidDismiss: EventEmitter
Expand All @@ -49,7 +50,7 @@ export class AtomModal {
}

componentDidLoad() {
document.body.classList.remove(BACKDROP_NO_SCROLL)
document.body.classList.add(BACKDROP_NO_SCROLL)

this.modal.close = async () => {
await this.modal.dismiss()
Expand Down Expand Up @@ -95,6 +96,7 @@ export class AtomModal {
}}
onIonModalDidDismiss={this.handleDidDimiss}
onDidPresent={this.handleDidPresent}
isOpen={this.isOpen}
>
<header part='header' class='atom-modal__header'>
{iconType && (
Expand Down

0 comments on commit fa5b319

Please sign in to comment.