Modal not hidden

Hi Friends! can you help me? I have a modal that is showing up without being called and i hapens when i style it. Specifically when I display: flex on it. Do you know why this happens? Weird thing, it happens only on that modal but not on the other one that also has flex https://codepen.io/Ari-Cohelo/pen/WNYoBjR
#deleteModal {
display: flex;
flex-direction: column;
align-items: center;
border: none;
border-radius: 15px;
padding: 20px;
background-color: rgb(255, 217, 167);
}
#deleteModal {
display: flex;
flex-direction: column;
align-items: center;
border: none;
border-radius: 15px;
padding: 20px;
background-color: rgb(255, 217, 167);
}
2 Replies
ChooKing
ChooKing10mo ago
The default display value for a dialog element without the open attribute is display:none. It is normal for display:flex to make it become visible by overriding the default display:none. Here is a minimal proof: https://codepen.io/chooking/pen/mdaEMWW The addModal dialog is hidden properly because it does not have display:flex. That is applied to the form inside the dialog.
AriCohelo
AriCohelo10mo ago
Great response! thanks!