django-admin-sortable2 icon indicating copy to clipboard operation
django-admin-sortable2 copied to clipboard

Columns expand continuously with each sort

Open djflorio opened this issue 9 years ago • 0 comments

Django 1.10 Python 3.5.2

Funny little bug here. Whenever I sort these two models in the admin site, their columns slightly expand horizontally. This continues as long as I sort the items, and the columns reset at a page refresh.

Initial view: screen shot 2016-10-06 at 11 14 45 am

After sorting the items 3 times: screen shot 2016-10-06 at 11 18 18 am

After sorting the items 10 times: screen shot 2016-10-06 at 11 17 26 am

Here's the model being sorted in the above screenshots:

class WorkLogo(models.Model):
    name = models.CharField(max_length=200)
    image = models.ImageField(null=False)
    order = models.PositiveIntegerField(default=0, blank=False, null=False)

    def __str__(self):
        return self.name

    class Meta(object):
        ordering = ('order',)

And the code that adds the model to the admin site:

class WorkLogoAdmin(SortableAdminMixin, admin.ModelAdmin):
    model = WorkLogo

admin.site.register(WorkLogo, WorkLogoAdmin)

djflorio avatar Oct 06 '16 15:10 djflorio