-
-
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
[IME] Composition does not start with first typed character in empty inline style. #3084
Comments
Tadada, @pjasiun, yet another example we can't be rendering when composition takes place :P Most likely, this is due to removing the block filler on first selection change. |
I'm not saying we should do nothing. I'm saying we should break nothing. |
There are actually two cases here:
Those cases are a bit different because a different filler is used in both of them. In both cases it breaks the composition. |
This is an important bug because it makes it hard to type anything using composition after applying any inline style. |
OK, it may not be about the block filler and inline filler actually. If it would be a problem with removing the block filler, it would also happen in an empty paragraph without applying bold there. But it works fine in such a case. Also, @f1ames told me that he observed that the entire inline element is being re-rendered. So maybe, somehow, we lose a reference to that node (we replace it in the view with a new attribute element when converting the first typed letter) so we remove it and re-insert a fresh one to the DOM. If so, then this is a big problem. If, as I expected until being enlightened, the renderer just diffed the view and DOM elements, we would have no such issues. The conversion may often just wipe out the old view elements and reinsert nearly identical ones. In such cases, it'd be great if we didn't have to re-render them. One idea that I have is that perhaps view<->DOM mapping could be smarter and check whether the new element resembles the old one (and if so, it would re-bind them). We need to talk about this on Monday. cc @pjasiun |
Just a quick note. It may also be a problem with the view writer. Let's say we have an initial situation with a bold applied to an empty selection: <p><strong>{}</strong></p> After converting insertion of the letter we have: <p><strong>{}</strong>a</p> And after converting an attribute of that letter we have: <p><strong>{}</strong><strong>a</strong></p> (or a reverse situation - Now, the writer also needs to merge these two elements. If it merges the one in which the selection was to the newly created one then we lose the reference. Maybe it can be fixed there. |
The case of writing in the empty, bolded block should work fine in the current architecture. This is exactly why we have selection attributes. We should not block anything. But, in fact, in the current implementation, writer split and merge attributes elements as many time as it wants and renderer can't handle replacing one attribute element with another. It might be the reason of bugs. We should make one of these 2 guys (writer or renderer) smarter. Since the writer is already very complicated improving renderer might be the way to go. But yes, we need to talk on Monday. |
It's not about selection attributes and rendering the empty |
Fix: Renderer should avoid doing unnecessary DOM structure changes. Ensuring that the DOM gets updated less frequently fixes many issues with text composition. Closes #1417. Closes #1409. Closes #1349. Closes #1334. Closes #898. Closes ckeditor/ckeditor5-typing#129. Closes ckeditor/ckeditor5-typing#89. Closes #1427.
Bold
to create empty bolded style.'
in Spanish,a
in Hiragana).First character is inserted but does not start a composition.
The text was updated successfully, but these errors were encountered: