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

Widget doesn't work on forms that are part of formsets #71

Open
jasonhoward64 opened this issue Jul 16, 2018 · 2 comments
Open

Widget doesn't work on forms that are part of formsets #71

jasonhoward64 opened this issue Jul 16, 2018 · 2 comments

Comments

@jasonhoward64
Copy link

No description provided.

@timmyomahony
Copy link
Owner

timmyomahony commented Feb 12, 2020

I believe that this is because the JavaScript from pagedown_init.js used to set up the pagedown widget is only run once on page-load. Therefore when a new form is added to a formset, the JavaScript needed to set it up isn't executed.

I'm not sure there is a quick-fix for this. On the Django-admin, we might be able to listen for an event that is fired when a new inline is added (although I'm not sure this actually exists?). If you are using the widget in your own form you'll need to manually call DjangoPagedown.createEditor(element) (where element is the .wmd-wrapper element) yourself when the new form is added

@jmcaballas
Copy link

Will the inline form events in Django 4.1 help with this?
https://docs.djangoproject.com/en/4.1/ref/contrib/admin/javascript/

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

No branches or pull requests

3 participants