You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Crispy renders the form's Media before the form in the HTML. is this correct and helpful?
I can mostly imagine cases where first the HTML tags are added in the DOM (e.g. via HTMX), and afterwords the js code should be executed, because it searches the DOM for some ids or classes and puts some event listeners onto them.
I know very little about JavaScript so I can't really comment on one approach over the other. However, the fact that it's been like that for this long makes me believe folk will be relying on the current configuration.
Description:
Crispy renders the form's Media before the form in the HTML. is this correct and helpful?
I can mostly imagine cases where first the HTML tags are added in the DOM (e.g. via HTMX), and afterwords the js code should be executed, because it searches the DOM for some ids or classes and puts some event listeners onto them.
Demo code (simplified):
In the default setting, where crispy renders Media before the form,
document.querySelectorAll(".increase-time-button")
finds nothing.When I write
everything works as intended.
So I suppose it would be better to put it after the form.
Does anything speak against that?
The text was updated successfully, but these errors were encountered: