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

problem with loading ckeditor widget in template #152

Closed
parsamrz opened this issue Jul 17, 2023 · 3 comments
Closed

problem with loading ckeditor widget in template #152

parsamrz opened this issue Jul 17, 2023 · 3 comments

Comments

@parsamrz
Copy link

Hi, I have installed the ckeditor5 package in my Django app. I have model fields like bellow

description = CKEditor5Field(blank=True,null=True,config_name='extends')
and a model form .and my problem is when I want to render a form in a template when I call {{ form.as_p }} and {{ form.media }} it will load ckeditor completely
but when I call {{ form.description }} with {{ form.media }} field directly it won't work can you please help me with this?

image

@parsamrz
Copy link
Author

in console, it gives me this error


Uncaught TypeError: Cannot read properties of null (reading 'style')
    at Sx (app.js:37:56)
    at HTMLDocument.<anonymous> (app.js:73:5)


image

@parsamrz
Copy link
Author

Anyone ?

@hvlads hvlads closed this as completed Jul 30, 2023
hvlads added a commit that referenced this issue Jul 30, 2023
hvlads added a commit that referenced this issue Jul 30, 2023
Fix issue #152: labelElement floating issue for CKEditor5Field.
@hvlads
Copy link
Owner

hvlads commented Jul 30, 2023

Hi,

I understand the issue you're facing with rendering the {{ form.description }} field directly in your Django template with {{ form.media }}.

Based on the information provided, it appears to be a bug in the code. When using {{ form.as_p }} along with {{ form.media }}, the CKEditor loads correctly. However, when using {{ form.description }} directly with {{ form.media }}, the CKEditor doesn't load as expected.

To address this bug, I will investigate the issue further and work on fixing it in the latest version of the CKEditor5 package. I'll ensure that the {{ form.description }} field, along with {{ form.media }}, works seamlessly in the template, just like when using {{ form.as_p }}.

Thank you for bringing this to our attention, and I apologize for any inconvenience caused by the bug. Your feedback is valuable in making improvements to the package, and I'll strive to resolve this issue promptly.

If you have any more information or specific steps that might help in debugging the issue, please feel free to share them. I'll do my best to address the problem and provide an update as soon as the bug is fixed.

Best regards,
Vladislav

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

2 participants