question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Swal keeps appearing in the bottom of my webpage.

See original GitHub issue

Hello! Great work with sweetalert2 and sorry if my question is not fitted to be here. However I wonder why my sweetalerts keep appearing at the bottom of my screen (see image: https://imgur.com/a/H8DlM).

I first thought this was some issue with my dependencies, but that was not the case because I created a codesandbox project to check that: https://codesandbox.io/s/k5117qon63

But it keeps appearing at the bottom!

I remeber having this issue with sweetalert-react and the fix for that was simply to import the ccs file, like this: import 'sweetalert-react/node_modules/sweetalert/dist/sweetalert.css' and I tried ti apply this to sweetalert 2 import 'sweetalert2/node_modules/sweetalert2/dist/sweetalert2.css', but it can’t find that file.

I have no idea how to fix this and all help is appreciated!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
Martinnordcommented, Oct 11, 2017

Oh THANK YOU! Been trying to fix this for hours and now it works! Maybe it would be worth mentioning this in the docs, like a little side note?

Anyways, thanks a lot @limonte. And great job with sweetalert2. I changed because of the inline-html and I’m exited you use it!

Cheers! 😃

1reaction
codemaker2015commented, Apr 20, 2020

It’s due to missing of css file. Use the following code to import sweetalert in your application

import Swal from 'sweetalert2/dist/sweetalert2.js';
import 'sweetalert/dist/sweetalert.css';
Read more comments on GitHub >

github_iconTop Results From Across the Web

Prevent automatic page refresh with SweetAlert - Stack Overflow
Prevent automatic page refresh with SweetAlert · Pretty sure SweetAlready allows the usage of the await keyword. Try using await Swal.fire({...}).
Read more >
Notary Public & eNotary Handbook - Arkansas Secretary of State
WHAT IS A NOTARY PUBLIC? 1. APPLICATION AND RENEWAL PROCESS. 1. Qualification. 1. Application. 2. Renewal. 6. CHANGES IN PERSONAL INFORMATION.
Read more >
SweetAlert2 - a beautiful, responsive, customizable and ...
A beautiful, responsive, customizable and accessible (WAI-ARIA) replacement for JavaScript's popup boxes.
Read more >
How to avoid layout shifts caused by web fonts - Simon Hearne
One of the biggest causes of layout shifts for my clients is late-loading web fonts, let's look at how to optimise them!
Read more >
Taskbar showing in fullscreen? Here's how to fix it
The taskbar overlaying on top of games or web browsers. ... Your taskbar is the strip going across the bottom of the screen...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found