-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Japanese Hiragana Windows IME ignores first letter in editor #1453
Comments
Update: removing |
Same as #1437 |
Misread the actual behavior, while not exactly the same, using a Japanese IME on osx produces similar result. Expected behavior: I suspect the text node value on the first keypress is added to the line and current index of the line is moved by 1, which is why on Japanese IME pressing This happens on the dom mutation event callback observed by Parchment.Scroll (and extended by blots/scroll.js), where it creates a text blot & text node on the first keypress on a new line. Adding the subsequent keypresses properly appends, because probably Scroll/Container found a parent node to append to instead of creating a new text node. But I still cannot find the exact code that consumes the first keypress and move current index forward 😿 |
@azam removing the |
I tried deleting these lines, just to see if the https://github.com/quilljs/quill/blob/master/core/quill.js#L73 I am testing it out using the local server (http://localhost:9000/standalone/snow/) on macOS Sierra, Chrome 58, Japanese IME (both default Apple & Google Japanese IME) if it helps. Reason of me suspecting the mutation observer callback is because when I comment out the following line, the first key stopped finalizing as a text node, so I am guessing that the problem lies after this line, or any events emitted after this. https://github.com/quilljs/parchment/blob/master/src/blot/scroll.ts#L134 Continuing to debug the issue ... |
(After some time trying to make the local dev server available to my IE VM) I tried dropping |
@azam ok I can repro on mac now, and it's intermittent. Tab A: no bug, Tab B (incognito): bug |
I've tracked this down to The problem is caused by inserting the textNode of the first text blot before the block:
|
How to fix it is a mystery at this point, especially considering it doesn't always happen. |
I believe this may in fact be the same bug as reported in #1437 . That was closed when users disabled the evernote plugin, however discovered that the bug always happens for me in an incognito window in chrome. Also the bug happens if I disable 1password. Enable it: fixes the bug. |
Update: 1password extension fixes the bug in safari & chrome. Nothing makes any sense anymore. Up is down. |
I believe I have reproduced the root cause in this pen: https://codepen.io/saw-1473371988/pen/Wjzmay Basically the IME seems to think the first character is after the insertion point, but the insertion point is corrected after the text node is appended to the block node (I think this happens in |
Here is what I think is happening: When you type the first character in the editor quill creates a |
Problem cannot be reproduced on develop. Suspecting 01e567e fixed the problem. |
@azam I can reproduce in develop, try it in an incognito window. |
When I installed this add-on, IME works correctly. environment: |
I'm exploring solutions to this. The basic issue is we can't append the textNode to it's parent while the IME is open. I've "fixed" the problem by stopping |
here is one possibly crazy option, change the default child of |
The above change fixes the bug, but is a significant change and probable wrong. @jhchen do you have a suggestion for solving this that wouldn't be as sweeping and destructive? |
Here is an override that fixes the issue completely, but you will need to scrub the |
I changed ZWS to NUL on as shown on this branch: azam/quill@c7cc4ca199e6bdf9281c93a4907f581063576851 . I agree that it is a quick workaround. If you want to go this way, there is a lot more to do. I think you might also want to override other inherited methods (length, value, etc) to absorb the change rather than let the user scrub the text themselves. For example, one of the effects of not overriding these methods is, try writing something and then deleting all text, Editor#isBlank do not evaluate to true, so the place holder will not be shown afterwards. Creating some sort of a new type of blank blot probably makes more sense. |
For our internal use I think I have some overrides that work (I'll add you to the pull request @azam ) but I'm not sure the ideal solution for the library |
I can confirm Windows + IE11/Edge is confirmed to not be working. Chrome/Safari should be working as of 0e7a10c |
Do someone track this bug?@jhchen ,I have try your method on Chrome/Safari,but it doesn't work. |
Interesting find: change the ql-blank to use :after rather than :before, so toggling the class does not trigger the contents to reflow, thus making the IME happy. But there's a catch, you need to manually position the :after pseudo element with top equal to the inner padding of the editor, about 12px for snow theme. I think this is acceptable 🤔 Update: The Chinese IME still doesn't work after this change, it seems the IMEs are extremely fragile and any updates to the containers can be devastating during compositions. Update's Update: It turns out that the Chinese IME's bug is not relevant to this issue, the proposed fix should work. |
The original steps for reproduction is now working on the latest version of Quill 1.2.6 on the latest IE 11.483.15063.0 and MS Edge 40.15063.0.0. @saw can you try with the latest and see if you are still having issues? |
I will as soon as I get back from vacation later this month
…On Mon, Jul 17, 2017 at 07:04 Jason Chen ***@***.***> wrote:
The original steps for reproduction is now working on the latest version
of Quill 1.2.6 on the latest IE 11.483.15063.0 and MS Edge 40.15063.0.0.
@saw <https://github.com/saw> can you try with the latest and see if you
are still having issues?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1453 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AABT5xULuhldYpmC0ji2pSzLNajh9cOdks5sOutigaJpZM4NWLyE>
.
|
@jhchen it does not seem to be happening anymore. Do you happen to know what changed to fix this? I'm really curious how you did it. |
I can't recall exactly. Try git bisect? |
worked before, but recently reappeared. |
I also again appeared a bug in window chrome |
I found a solution to this issue with IE11. The following CSS will fix this issue. .ql-editor::before {
visibility: hidden;
color: rgba(0, 0, 0, .6);
content: attr(data-placeholder);
font-style: italic;
left: 15px;
pointer-events: none;
position: absolute;
right: 15px;
}
.ql-editor.ql-blank::before {
visibility: visible;
} Try this with IE11 and IME : https://jsbin.com/kujavudoki/1/edit?html,css,js,output I think this issue is caused by changing the DOM tree with psudo-element "::before". If psudo-element is always in the DOM tree, IME will be correct. |
It also reappeared in version 2.0.0-dev.2 |
This problem occurs in Windows 7 and does not in Windows 10.
Quill 2.0 has been released (announcement post) with many changes and fixes. If this is still an issue please create a new issue after reviewing our updated Contributing guide 🙏 |
Typing with the IME enabled in windows 8/IE 11 the very first character seems to be ignored by the IME
Expected behavior:
result: てすと
Actual behavior:
result: t えすと
Everything is fine after that
Platforms:
Windows 8.1/ IE 11
Version:
1.2.4
The text was updated successfully, but these errors were encountered: