Skip to content
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

fix: Prevent datetimeshortcuts from rendering multiple times #129

Conversation

vxsx
Copy link
Contributor

@vxsx vxsx commented Aug 16, 2024

This was happening because scripts injected inside $(document).ready(...) would delay onload event and django's DateTimeShortcuts script attaches an event handler to load event to initialize the widgets. What would happen is our own initialization would run first and the one coming from django second resulting in duplicate widget. This change ensures our initialization happens last.

See #128

This was happening because scripts injected inside
`$(document).ready(...)` would delay onload event and django's
DateTimeShortcuts script attaches an event handler to `load` event to
initialize the widgets. What would happen is our own initialization
would run first and the one coming from django second resulting in
duplicate widget. This change ensures our initialization happens last.

See silentsokolov#128
@silentsokolov
Copy link
Owner

silentsokolov commented Aug 16, 2024

I tested on Firefox / Chrome / Safari, everything is ok
Thank you!

@silentsokolov silentsokolov merged commit 311197f into silentsokolov:master Aug 16, 2024
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants