applegrew / django-select2

This is a Django integration for Select2
MIT License
710 stars 316 forks source link

Clean option no works properly #588

Closed OVarLaz closed 4 years ago

OVarLaz commented 4 years ago

Describe the bug Visual bug in django-select2 option, when I try to clean the content in the box, removing all items, but if I select a new, I get a blank space. I use django-select2==7.2.0 (lastest version)

Exception & Traceback If I click 2 times in the "x", the content is cleaned completely

Code Snippet forms.py image

views.py

especialidadesFormset = CentroInvestigacionEspecialidadForm(prefix='especialidades')

reg.html

<div class="col-12">
       {{ especialidadesFormset.management_form }}
        {% for form in especialidadesFormset %}
              {{ especialidadesFormset }}
        {% endfor %}
  </div>

To Reproduce Steps to reproduce the behavior:

  1. Go to the view with the select2 field
  2. Add/select one or more options
  3. Remove all items, clicking in "x"
  4. Select another item of the list
  5. Will see a blank selection before the last selected

Expected behavior It must not show that blank space, with my selection

Screenshots x

codingjoe commented 4 years ago

Hi @OVarLaz the CentralInvestigationEspecialidad model with me as well? Best Joe

codingjoe commented 4 years ago

This repo has moved, please address your issue at https://github.com/codingjoe/django-select2 Thanks!