-
-
Notifications
You must be signed in to change notification settings - Fork 732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
crispy should render form.media after the form as default #1331
Comments
Mainly the fact that it's been like this for a quite some time, it was originally introduced 9 years ago. 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. The form template is fairly small, so one suggestion could be to use a custom template and set it using the |
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: