Replies: 1 comment 2 replies
-
The current behavior where the dialog shows instantly if |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If a Dialog initially has the
open
attribute set when rendered, no opening animation will be shown. However, it would be useful to be able to open a Dialog by adding it to the DOM with theopen
attribute set. In this case we would want the opening animation to be shown.In this codepen we add the Dialog element as open after the page has loaded, and therefore the opening animation is not shown. In a more realistic use-case we might render the Dialog on the server, and then inject it into the DOM using either something like HTMX. Currently we would have to first render the Dialog without
open
, then use Javascript to open it as soon as the dialog has been initialized in order to make the opening animation work.I think it would be useful to add a new attribute to achieve this. Another option would be to always run the open-animation when the Dialog is added to the DOM, but I can imagine some use-cases where you do not want this to happen (for example on initial page load).
What are your thoughts about this?
Beta Was this translation helpful? Give feedback.
All reactions