sweetalert2 / ngx-sweetalert2

Declarative, reactive, and template-driven SweetAlert2 integration for Angular
MIT License
652 stars 94 forks source link

Content shrinking when popup opens #260

Closed shadow1349 closed 9 months ago

shadow1349 commented 9 months ago

Here's an image of what's happening

image

I'm using Angular 17, ngx-sweetalert 12.2.0, sweetalert2 11.9.0. I'm also using TailwindCSS 3.0.2

In app.config.ts I have

export const appConfig: ApplicationConfig = {
  providers: [
    provideRouter(appRoutes, withEnabledBlockingInitialNavigation()),
    provideAnimations(),
    importProvidersFrom([
      SweetAlert2Module.forRoot(),
    ]),
  ],
};

Then in my component I have

@Component({
  selector: 'staffxtreme-main',
  standalone: true,
  imports: [
    RouterModule,
    SidenavComponent,
    NavigationPanelComponent,
    MatButtonModule,
    MatIconModule,
    SweetAlert2Module,
  ],
  templateUrl: './main.component.html',
  styleUrls: ['./main.component.scss'],
})
<button [swal]="['Oops!', 'This is not implemented yet :/', 'warning']">
   clickme!
</button>

Thanks for your time and efforts!

shadow1349 commented 9 months ago

Just poking around, I can see this is what's causing the issue

body.swal2-height-auto {
    height: auto !important;
}

I'm not sure how to mitigate that though. I tried adding height:100% !important in my main styles file but that keeps getting overridden by sweetalert.

limonte commented 9 months ago

https://sweetalert2.github.io/#heightAuto