Skip to content

bug: Inner positioned element stays visable after close #116

Answered by GrimLink
DavidvandenPol asked this question in Q&A
Discussion options

You must be logged in to vote

@DavidvandenPol after checking the bug as mentioned in your issue the fix not that easy, for a general purpose case.

So I have converted this to a Q/A, and offer the solution here for any inner CSS components that use visibility, in combination with the dialog.

The issue only shows when a visibility: visible; is used inside a visibility: hidden; causing it to show up after closing the dialog.
Since we use this to add animations to the dialog close and open states, this needed here.

To solve this make sure to only set the visibility property for you child element only when hidden, example;

.element:not(.is-open) {
  visibility: hidden;
}

Or use the .dialog-inner and by setting display: none;

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by DavidvandenPol
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants
Converted from issue

This discussion was converted from issue #113 on September 13, 2022 13:45.