-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Prevent UI from reacting to the conversion in some situations #4473
Prevent UI from reacting to the conversion in some situations #4473
Comments
Alternatively, there's a fix proposed by @oskarwrobel:
|
Actually, we may try to set the default value of This way, there will rendering will be disabled until the first conversion https://github.com/ckeditor/ckeditor5-engine/blob/fd2005d2f84db05242d689ce3a31208f287e04c5/src/controller/editingcontroller.js#L82. This was the idea to solve another problem we had last week, but apparently, we did not need it. On the other hand, I agree that we could block |
After some testing and F2F talk we came up with @pjasiun to the conclusion that the above fix won't solve the problem and that the problem is a little bit deeper - So the proposal is to gather information in the model about changes and then fire this information in the |
Fix: Stopped invoking `view.render()` by `EditingController` when the model document isn't changed. Closes #1653.
I reopened this ticket because of https://github.com/ckeditor/ckeditor5-engine/issues/1660. |
Fix: Prevented `View` from firing the `render` event if there were no changes since the last rendering. Closes #1653. Closes #1660. BREAKING CHANGE: The `editing.view.render()` method was renamed to `editing.view.forceRender()`. It should be used with caution as it will re-render editing view and repaint the UI.
This issue is a continuation of the https://github.com/ckeditor/ckeditor5-table/issues/168.
In short:
Editors initialize plugins, UI, and then the data controller in that order. It might happen, that the data controller initialization is replaced with a custom implementation, which uses the conversion API to parse the initial data.
During such conversion, the view and the model are still
empty
. Among others, the view document selection is unset. The conversion triggers a cascade of eventsAfter latest changes in the
ckeditor5-table
andckeditor5-widget
, theWidgetToolbar
invokes the visibility callbacks for the table'stableContent
toolbar, which operates on the position (which is equal tonull
as the selection isn't set at this point.Such quick fix as:
https://github.com/ckeditor/ckeditor5-engine/blob/fd2005d2f84db05242d689ce3a31208f287e04c5/src/view/view.js#L161-L166
...works and doesn't break editor and existing tests. I'm not sure if it's perfect (but editor's UI shouldn't respond if the selection is empty).
PS: IMO, the conversion should be more
pure
, in that case, parsing invokes UI actions. So the fix could be even more generic, preventing any UI action during the parsing.The text was updated successfully, but these errors were encountered: