- Issue created by @trungnt34
- ๐ฉ๐ชGermany dbielke1986
Hi trungnt34,
Thanks for reporting this issue!
Can you please check whether the problem also occurs when the template module is deactivated / when the button for the templates is not in the toolbar?I assume that this is not an issue with the ckeditor5_template module.
BR
Daniel - ๐ป๐ณVietnam trungnt34
Hi dbielke1986,
The phenomenon only occurs when the template button has been activated. I have tried many times with the original ckeditor5 but did not encounter this phenomenon.
On the original ckeditor5, when dragging and dropping, sometimes the editor will flicker, but duplicate editors will not appear.
- ๐ฉ๐ชGermany dbielke1986
Ok, I will install the paragraph field and try to reproduce the behavior.
Iยดll keep you updated.BR
- ๐ฉ๐ฐDenmark ressa Copenhagen
I have also seen this with a plain Body-field, "Allowed number of values" set to "Unlimited". So it's really easy to reproduce, and I will add the steps in the Issue Summary.
Allowing multi-values in a field is not uncommon, so it would be great to get this looked at.
- ๐ฉ๐ชGermany dbielke1986
I can reproduce this issue. Thank you for reporting and providing the needed information.
We will resolve this issue as soon as possible.BR
- ๐ฉ๐ชGermany dbielke1986
We found the reason for this behavior, but currently we do not know how to fix this.
Maybe the community has an idea?The root is the asynchronous include which we need for the "fetch" function. This again is needed to load the template file dynamically.
https://git.drupalcode.org/project/ckeditor5_template/-/blob/1.0.x/js/ck...
export default class Template extends Plugin { async init() { const editor = this.editor; const template_config = this.editor.config.get('template'); console.log('Value: ', template_config['file_path']); const templateArray = await fetch(template_config['file_path']) .then(res => res.json()) .catch(error => console.log(error)); editor.ui.componentFactory.add('template', function (locale) {
If we remove the "async" and load the file statically, the duplication of the editor cannot be reproduced.
- Status changed to Closed: won't fix
9 months ago 7:18am 4 April 2024 - ๐ฉ๐ชGermany vincent.hoehn Dresden, Germany
Hi @adinan cenci,
we have decided not to fix this issue. Please have a look at the drupal documentation about the issue status field โ
BR
Vincent - ๐ฉ๐ฐDenmark ressa Copenhagen
So, this is still a bug, and multiple users encounter it ... I think it might be worth considering to keep the issue "Active", stating that it needs to be fixed, so that anyone who at some point finds a solution, finds this issue and can share it here. If the issue is closed, it may get overlooked.
I came up with this patch.
Not the best solution I know, leaving the data in memory like that, but it works for me.
- Status changed to Needs review
3 months ago 5:42pm 16 September 2024 - ๐ฉ๐ฐDenmark ressa Copenhagen
Thanks @adinan cenci! Hopefully someone with more code experience can review it.
- Assigned to vincent.hoehn