-
Notifications
You must be signed in to change notification settings - Fork 707
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
SortableStackInline breaks with Select2 #216
Comments
What this checking does is it verifies if any of new fieldset inputs has changed value, so that if you click multiple times to Add inline and enter none of fields it wouldn't add order value, otherwise on form save, empty inlines will be saved (because order field will have value). I'll try adding select2 to demo inline and see what i can do to fix the problem. |
I tried replicate problem, but everything seemed fine (except select2 won't work on new inlines, but that's another problem.
Could you please be more specific, what problems exactly it causes? |
The issue I ran into was that the order was not maintained. Did your test properly maintain the order of items in the sortable? |
Line 135 in sortables.js:
https://github.com/darklow/django-suit/blob/master/suit/static/suit/js/sortables.js#L135
Overly aggressively selects all hidden fields with a value. This Causes problems with the Select2 django integration because Selec2 uses a hidden input field to store the value of it's faux selectbox.
Specifically filtering for Select2 classes solves the problem but is too specific to Select2.
Fields that should be excluded should have a special class rather then relying on
type="hidden"
The text was updated successfully, but these errors were encountered: