[BUG] Rich Text Editor's position is not updated on enter/return
Question
Once again thanks for all the hard work on the project!
This is reproducible on the current release 0.16.3 - you can check it out in the newsletter demo: https://grapesjs.com/demo-newsletter-editor.html
Normally the RTE appears above the element so this is not an issue. However, when a RTE-enabled element is placed close to the top of the editor, there is no room for the RTE above the element, so it is placed below. When pressing "enter" or "carriage return", the RTE stays in place, blocking much of the element that is now below it.
To reproduce:
- Open GrapesJS
- Place a text field at the top of the editor
- Type some text and press enter.
When the user removes a row in the text element via backspace, the RTE's position is updated correctly and moves to the new edge of the element. But for enter, it does not move at all.
Answers (3)
@mazuschlag if you are using ckeditor then you can try this patch. It will re-calculate and re-position the ckeditor to the correct position.
CKEDITOR.on('instanceReady', function (e) {
editor.RichTextEditor.updatePosition();
});
Canvas tools should be updated on input event of the text component, in the current version there is an issue even with the built-in RTE but it will be fixed in the next release.
Somehow, this issue doesn't affect the CKEditor plugin but, from what I've seen, the "enter" never triggered the input event so I think there should be attached some other event to the CKEditor instance. I'd be glad to receive a PR on the plugin
@artf Thanks for the response but I'm a little confused. This is happening with the CKEditor plugin - are you saying the fix will be separate from the fix to the built in CKEditor? I wouldn't mind fixing it but do you have some pointers on where to start?
Related Questions and Answers
Continue research with similar issue discussions.
Issue #4173
BUG: Text element does not work properly
GrapesJS version[X] I confirm to use the latest version of GrapesJSWhat browser are you using? Chrome v98Reproducible demo link https://gra...
Issue #2878
[Bug] its not possible to make part of H1 non-bold
Steps:open newsletter demo at https://grapesjs.com/demo-newsletter-editor.htmlclean the canvasdrop "Text Section"select any word within H1,...
Issue #6369
BUG: Display order of border radius is not correct
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome v130 Reproducible demo link https:/...
Issue #5046
BUG: is there any way to remove cross svg on selected default value of Float, Position and text-align
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Version 111.0.5563.147 (Official Build) (6...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.