-
-
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
Composition breaks when typing a Korean phonetic radical after typing space
key on Android Chrome
#13693
Comments
bug: typing Korean on Safari at v34 was resolved in v35, |
CKEditor version 35.4.0 is also affected by this bug. |
Your solution seems works well at 36.0.1 |
👍🙏 |
@noncelab-tiger could you please tell me which method is used to build the editor? Thanks in advanced! 🙇♂️ |
You should edit |
I used the online builder. I modified the code in the path below. The code is minified so it may be hard to find.
if (t === "insert") {
bc(n, c, r[c]);
c++
} else if (t === "replace") {
Uf(o[c], r[c].data); // this code
c++
} else if (t === "equal") {
this._markDescendantTextToSync(this.domConverter.domToView(r[c]));
c++
} |
Very helpful! |
If the following error occurs, correct it as follows:
solution:
if (n === o) {
yield this._getBlockFiller()
}
}
viewRangeToDom(t) {
const e = this.viewPositionToDom(t.start);
const n = this.viewPositionToDom(t.end);
const o = this._domDocument.createRange();
if(e.offset > 0 || n.offset > 0){ // new code line
o.setStart(e.parent, e.offset - 1); // new code line
o.setEnd(n.parent, n.offset - 1); // new code line
} else { // new code line
o.setStart(e.parent, e.offset);
o.setEnd(n.parent, n.offset);
} // new code line
return o
}
viewPositionToDom(t) {
const e = t.parent;
if (e.is("$text")) {
const n = this.findCorrespondingDomText(e); |
The work for this issue and others related is completed in the #16289, and we finalized the round of internal (successful) tests. I encourage everyone to test the PR if you have a chance. It should be merged in the following days, and will be a part of the next release. |
Fix (typing, engine): Predictive text should not get doubled while typing. Closes ckeditor#16106. Fix (engine): The reverse typing effect should not happen after the focus change. Closes ckeditor#14702. Thanks, @urbanspr1nter! Fix (engine, typing): Typing on Android should avoid modifying DOM while composing. Closes ckeditor#13994. Closes ckeditor#14707. Closes ckeditor#13850. Closes ckeditor#13693. Closes ckeditor#14567. Closes: ckeditor#11569.
📝 Provide detailed reproduction steps (if any)
ㄱ
ㅏ
space
ㄱ
ㅏ
screenrecording.webm
✔️ Expected result
가 가
❌ Actual result
가 ㄱㅏ
❓ Possible solution
Not updating Text node when composing, i.e. after
compositionstart
event and beforecompositionend
event, by adding the following code intorenderer.ts
:ckeditor5/packages/ckeditor5-engine/src/view/renderer.ts
Lines 714 to 728 in 1bbb4df
On Android Chrome, when a character is typed and the typing triggers a
compositionstart
event, IME seems to put the character into the Text node sometime aftercompositionupdate
event. Meanwhile CKEditor also effectively puts the character into the node by invokingupdateTextNode
. So there would be two same characters.MutationObserver
detects the DOM mutation and invokes anotherupdateTextNode
. Because of that invocation one of the two characters is removed. This can be confirmed by uncommentingCK_DEBUG_TYPING
console.log
s. I suspect that which character is removed affects whether the current composition should break, i.e. IME seems to be keeping track of which character instance is involved in the current composition.The suggested solution will prevent the character duplication. IME will put the character while CKEditor won't. Thus there would be no removal of the duplicated character. Neither be composition-breaking.
📃 Other details
If you'd like to see this fixed sooner, add a 👍 reaction to this post.
The text was updated successfully, but these errors were encountered: