django-json-widget icon indicating copy to clipboard operation
django-json-widget copied to clipboard

Editor working unproperly in TabularInline

Open raulfc2000 opened this issue 8 months ago • 2 comments

  • django-json-widget version: 2.0.1
  • Django version: 5.0.6
  • Python version: 3.12.4
  • Operating System: Debian

Description

Hello! I am using this library in some projects, but I found a problem specifically when using in a Django admin.TabularInline.

class MyModelInLine(admin.TabularInline):
    model = MyModel
    extra = 0
    verbose_name = _('MyModel')
    verbose_name_plural = _('MyModels')
    fields = (
       'id_link', 'additional_information',
    )
    readonly_fields = (
        'id_link',
    )
    formfield_overrides = {
        models.JSONField: {'widget': JSONEditorWidget(height='350px', width='1000px')}
    }

What I Did

Basically, when I open a new row in the Inline, it appears the widget, but I cannot modify it. imagen I can click, I can try to type but it doesn't work

Tried this in Chrome and Firefox and got the same results.

However, if it already has data, it is possible to modify imagen

Thank you very much for reading, I hope you can replicate it :)

raulfc2000 avatar Jun 24 '24 09:06 raulfc2000