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 falls apart on component collapse #143

Closed
sadeq-qafari opened this issue Jan 2, 2025 · 7 comments · Fixed by #144
Closed

Editor falls apart on component collapse #143

sadeq-qafari opened this issue Jan 2, 2025 · 7 comments · Fixed by #144
Labels
pending:feedback This issue is blocked by necessary feedback. type:bug This issue reports a buggy (incorrect) behavior.

Comments

@sadeq-qafari
Copy link

if I use ckeditor in a component then use it in some collection as a repeatable component, while using it if i collapse a component which contains editor every editor on that page falls apart like this

Image

then if i expand same component or some other one containing ckeditor the problem will be fixed, i guess some styling is removed when collapsing a component.

its problematic the most while I'm using repeatable component and i want to switch between items.

@Mgsy
Copy link
Member

Mgsy commented Jan 7, 2025

Hi @sadeq-qafari! Could you please share the exact steps to reproduce the issue and your Strapi version?

@sadeq-qafari
Copy link
Author

Hi @Mgsy!

Thank you for your response! Here are the steps to reproduce the issue:

  1. Create a component and include CKEditor as one of its fields.
  2. Add this component to a content type as a repeatable component.
  3. Start adding entries and use the repeatable component to add multiple items.
  4. Expand and collapse the components. You'll notice the issue where the editors break upon collapsing, but they return to normal when expanded again.

Strapi version: v5.4.2

@sadeq-qafari
Copy link
Author

any update on this?

@Mgsy
Copy link
Member

Mgsy commented Jan 16, 2025

@sadeq-qafari I managed to reproduce the issue. It is related to the process of cleaning the assets. It seems there is problem while clicking between the components, but if you close one component, then expand another one, it works as expected.

The assets are cleaned after unmounting the component, so probably the second editor instance still detects the injected assets, as the first component is still available, but the assets get cleared a while after, which results in missing CSS files.

I will work on the fix.

@Mgsy
Copy link
Member

Mgsy commented Jan 16, 2025

I opened a pull request with a fix. Can you please check it and verify if it solves the problem?

PR for Strapi 5: #144
PR for Strapi 4: #145

@Mgsy Mgsy added the pending:feedback This issue is blocked by necessary feedback. label Jan 16, 2025
@sadeq-qafari
Copy link
Author

Hey @Mgsy,
Sorry for the delay
Tried your changes and it solves the problem!
Thank You!

@Mgsy
Copy link
Member

Mgsy commented Jan 20, 2025

Great, I will merge changes and this week I will prepare the release.

@Mgsy Mgsy closed this as completed in #144 Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending:feedback This issue is blocked by necessary feedback. type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
2 participants