-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
WidgetTypeAround should use insertContent in order to integrate with track changes #7229
Comments
PS. I'm not entirely sure whether it's possible to insert a new empty paragraph with |
PPS. The Enter/Shift+Enter support uses |
I asked @ckeditor/qa-team to help us verify that it will resolve the issue on the CF side. Here, let's focus on whether we can use insertContent() as I'm not sure about that unfortunately. |
There is integration for enter command and there is integration for However, there's some kind of an error if you simply add a single paragraph 🤔 editor.model.change( writer => {
const p = writer.createElement( 'paragraph' );
editor.model.insertContent( p, writer.createPositionAt( editor.model.document.getRoot(), 0 ) );
} ); Most probably, the range is set in an incorrect way. I can't guarantee that we will be able to fix that in this iteration. EDIT: It works if you add paragraph with some text. |
Note to clarify: Enter command is handled properly, however, not in a context of widgets - after pressing Enter/Shift+Enter, a new paragraph is inserted, instead of a suggestion. |
I see @oleq that you created This can work. When you are done, could you please add an issue in collaboration features repository so we can work on it and have it done hopefully this iteration? |
In a F2F talk with @scofalik we decided:
|
FYI: The quick fix landed in 005a5d2. |
Internal (widget): Integrated the `WidgetTypeAround` plugin with the read–only mode. Closes #6775. Internal (widget): Integrated the `WidgetTypeAround` plugin with the `RestrictedEditingMode` plugin (see #6775). Feature (paragraph): Implemented the `InsertParagraphCommand` registered as `'insertParagraph'` in the editor. Closes #6823. Closes #7229. Docs (engine): Improved `Model#insertContent` API documentation (see #6775).
📝 Provide a description of the improvement
It uses
writer.insert()
while it should usemodel.insertContent()
.In addition, it should probably copy the implementation of the current <kbd>Enter</kbd> handler that we have for widgets. AFAICS it does some more checks.
If you'd like to see this improvement implemented, add a 👍 reaction to this post.
The text was updated successfully, but these errors were encountered: