Enhancement: Allow positioning the popup programatically.
See original GitHub issueThere are times where I don’t always want the popup positioned in the center of the screen. Actually, I prefer it to be centered and top, like chrome’s default alert. That way it doesn’t block whatever is covering the screen.
Currently, its possible with css, but not practical as you might not always want that:
.swal2-modal {
margin-top: 0 !important;
}
Other possibilities could include: right
left
bottom
top-right
top-left
…etc?
swal({
//....
position: 'top-left',
});
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:15 (8 by maintainers)
Top Results From Across the Web
Popup - .NET MAUI Community Toolkit - Microsoft Learn
The Popup view allows developers to build their own custom UI and present it to their users.
Read more >Swift 4 Position of element programmatically - popup
Guys i use https://github.com/daisuke310vvv/PopupController library as PopUp my ... let popup = PopupController.create(YourViewController).
Read more ><af:popup> - Oracle Help Center
A dialog can be repositioned on the page using drag-and-drop. The title bar is the gripper for the drag source. Dialogs will be...
Read more >Popup Widget | jQuery Mobile API Documentation
See methods for information about setting the popup position programmatically, including the option to specify x and y coordinates.
Read more >Enable Popups for each layer in webmap using ArcGIS API for ...
Confirmed with ESRI that is not possible to enable popups with ArcGIS API for Python. There is currently an enhancement in the ArcGIS...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Aha, that’s already possible with the
target
option 😃 Pass it the Swal parent container (body
by default) and the modal will attach itself to it and displayed in the middle of it. So if you screen is divided in two parts for example, give Swal one of the two containers, and the modal will be perfectlty centered in it!glad it worked now @Franki1986. I agree we should add an example, but it’s not easy with the design of the current documentation page. Let us think about it.