Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Newline added when resolving composition in IE11 #2080

Open
robbertbrak opened this issue May 22, 2019 · 3 comments
Open

Newline added when resolving composition in IE11 #2080

robbertbrak opened this issue May 22, 2019 · 3 comments

Comments

@robbertbrak
Copy link
Contributor

To reproduce:

  • Use the latest version of Draft (i.e., one that includes 634bd29, the awesome fix by @fabiomcosta to support Android)
  • In IE11, open the rich text example
  • Switch to Chinese (Simplified, PRC), and use the IME "Microsoft Pinyin New Experience Input Style". This one comes standard with Windows 7.
  • Repeat several times: type nihao1 and press <enter> to resolve the composition

Result: after about 5 repetitions, you'll notice that the editor area grows, because there is a redundant newline added each time the composition is resolved:

screencast 2019-05-22 14-15-48

Note that this can also be reproduced with other IMEs in IE11, such as the standard Korean one.

A possible fix might be to strip trailing newlines when the composition is resolved, on line https://github.com/facebook/draft-js/blob/master/src/component/handlers/composition/DraftEditorCompositionHandler.js#L206

@fabiomcosta
Copy link
Contributor

fabiomcosta commented May 22, 2019 via email

@robbertbrak
Copy link
Contributor Author

@fabiomcosta It looks to be limited to IE11. I could reproduce it both on Windows 7 and Windows 10.

BTW Now that I'm testing a bit more, I noticed that Edge has a worse problem. When the block is empty, any composition completely disappears when it is resolved:

screencast 2019-05-22 17-24-08

I'll create a separate issue for that.

@mrkev
Copy link
Contributor

mrkev commented Dec 18, 2019

This should be fixed by #2285

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants