fix(toast): align to the center with actual element width (#847)

close #843

---------

Co-authored-by: LinkinStars <linkinstar@foxmail.com>
This commit is contained in:
Shaobiao Lin
2024-03-15 10:51:58 +08:00
committed by GitHub
parent 64381f1682
commit 7e1d03e2cf
+3 -3
View File
@@ -25,9 +25,9 @@ import ReactDOM from 'react-dom/client';
const toastPortal = document.createElement('div');
toastPortal.style.position = 'fixed';
toastPortal.style.top = '90px';
toastPortal.style.left = '0';
toastPortal.style.right = '0';
toastPortal.style.margin = 'auto';
toastPortal.style.left = '50%';
toastPortal.style.transform = 'translate(-50%, 0)';
toastPortal.style.maxWidth = '100%';
toastPortal.style.zIndex = '1001';
const setPortalPosition = () => {