django-select2 icon indicating copy to clipboard operation
django-select2 copied to clipboard

Fix #297 -- Add Django admin' inline formset support

Open mardukbp opened this issue 1 year ago • 1 comments

As described in #249 and #297 django-select2 does not currently work with selects added dynamically in the Django admin.

The solution was implemented in #249 and all credit should go to Jurrian Tromp. I only added a small correction:

- jqRow.find('.select2-container').remove()
+ jqRow.find('.django-select2').parent().find('.select2-container').remove()

to only remove .select2-container when it is a sibling of .django-select2. Otherwise the wrong .select2-container might get deleted.

mardukbp avatar Sep 16 '24 13:09 mardukbp

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.23%. Comparing base (f61b09c) to head (3599159). Report is 16 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #300      +/-   ##
==========================================
+ Coverage   98.21%   98.23%   +0.02%     
==========================================
  Files           7        7              
  Lines         280      284       +4     
==========================================
+ Hits          275      279       +4     
  Misses          5        5              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Sep 16 '24 16:09 codecov[bot]

@codingjoe the above code looks good to go, wondering when can it be reviewed and merged as a couple of my prod websites are affected, could wait a couple days before i create a fork myself and use that in my repos

sahilasopa avatar Sep 27 '24 12:09 sahilasopa

@codingjoe the above code looks good to go, wondering when can it be reviewed and merged as a couple of my prod websites are affected, could wait a couple days before i create a fork myself and use that in my repos

I left a comment. Once it's resolved I am happy to release this.

codingjoe avatar Sep 30 '24 11:09 codingjoe

Thanks for your suggestion @codingjoe. I tested it with my Django project and everything works. I apologize for taking so long to update my PR.

mardukbp avatar Nov 25 '24 15:11 mardukbp