I am new to the Semantic-UI-React framework, and recently ran across a problem that I can't seem to fix. I have a Log in & Sign up Modal on my home page. When the LogIn And Sign Up button is triggered, the Modal pops up. However, I cannot get it to appear in the center of the page. It is on the top of the page, and partially cut off. How do I go about doing this? Thank you in advance for your help!
The outer <div> containing the modal dialog has display: block; instead of flex which causes the misalignment. To be more specific, the definition display: flex of .dimmed.dimmable > .ui.visible.dimmer is for some reason overridden by display: block !important imposed by .visible.transition.
You might want to add the following to your CSS to fix this:
.dimmed.dimmable > .ui.modals.dimmer.visible {
display: flex !important;
}
Or, if you are using css modules:
:global(.dimmed.dimmable > .ui.modals.dimmer.visible) {
display: flex !important;
}
I came across this issue when learning react just months ago and this is how I sorted this issue.In my .css file under App.js folder just add:
.modal {
height: auto;
top: auto;
left: auto;
bottom: auto;
right: auto;
}
Hope it helps.Cheers
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With