Skip to content
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

Editor working unproperly in TabularInline #89

Open
raulfc2000 opened this issue Jun 24, 2024 · 3 comments
Open

Editor working unproperly in TabularInline #89

raulfc2000 opened this issue Jun 24, 2024 · 3 comments

Comments

@raulfc2000
Copy link

raulfc2000 commented Jun 24, 2024

  • 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 raulfc2000 changed the title Editor working unproperlly Editor working unproperly in TabularInline Jun 24, 2024
@aboutroots
Copy link

Can confirm, I have the same issue in my project when used within StackedInLine admin.

After saving the object, the default value is displayed correctly (in my case - empty dict) and is editable, but before saving the object, the widget does not display any data and is not responsive.

@MaaREKQA
Copy link

MaaREKQA commented Sep 5, 2024

styles are broken:
After
obraz
Before
obraz

@amirhakimnejad
Copy link

Experiencing the same issue here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants