You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Honestly, this should work like you described. During character deletion, caret is moved so model.Document.selection#_updateAttributes( true ) should be fired. This means that all attributes should be cleared and only attributes from caret neighbourhood. It's weird it doesn't work like this. There should be no need to refresh attributes.
Anyway, right now, there is no method to do so. Even setting selection to same position as it is won't work. So you'd have to collapse selection at different selection and then move it back. Or just use _updateAttributes( true ) (but it should work right now for deleteing, so IDK).
Unfortunately, this doesn't work as expected because of... how smart we made all this :D.
After deleteContents() run batch.remove() the live selection moves automatically to the place where we expect it to be, so setting it there explicitly in the next line doesn't trigger change:range.
So it seems that we'll have to update those attributes there anyway. And this leads to my next question – how to update selection attributes? Can we make the _updateAttributes( true ) method public?
This issue is visible after ckeditor/ckeditor5-engine#634.
This letter is now bolded, while it shouldn't. We agreed that deleting whole content of a bolded word should also remove the bold from the selection.
I'm not 100% sure whether this should be implemented by the
composer.deleteContents()
or the delete feature, but composer makes more sense.BTW, @scofalik, what would be the easiest way to implement that? How can I now refresh selection attributes so it reads all of them from the content?
The text was updated successfully, but these errors were encountered: