diff --git a/src/components/reactButton.js b/src/components/reactButton.js index 050fc9c..db1713c 100644 --- a/src/components/reactButton.js +++ b/src/components/reactButton.js @@ -91,6 +91,8 @@ export default function ReactButton({ onClick, existingReacts, uid }) { return ( <> { return ( + {text && text()} - {opened && {children}} + {opened && + ReactDOM.createPortal( + + {children} + , + document.body + )} ) } diff --git a/src/components/tooltip.module.css b/src/components/tooltip.module.css index 2f05f33..dba1ed5 100644 --- a/src/components/tooltip.module.css +++ b/src/components/tooltip.module.css @@ -3,21 +3,16 @@ display: inline-block; } -.tooltip .tooltiptext { - width: 300px; - max-width: 300px; - height: 250px; - max-height: 250px; +.tooltiptext { + position: absolute; + background-color: var(--background-color); border-radius: 5px; color: #fff; text-align: center; border-radius: 6px; padding: 5px; - position: absolute; z-index: 9999; - bottom: 100%; - left: 0%; margin-left: -60px; transition: opacity 0.3s;