This repository has been archived by the owner on Feb 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Newline added when resolving composition in IE11 #2080
Comments
Interesting, did you try this other flow on other browsers as well?
Just want to confirm if this is IE11 only or if other browsers are also
affected
On Wed, May 22, 2019 at 5:22 AM Robbert Brak ***@***.***> wrote:
To reproduce:
- Use the latest version of Draft (i.e., one that includes 634bd29
<634bd29>,
the *awesome* fix by @fabiomcosta <https://github.com/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:
[image: screencast 2019-05-22 14-15-48]
<https://user-images.githubusercontent.com/734581/58173741-6bfd1000-7c9c-11e9-89a3-76b6eed776f0.gif>
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
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2080>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAG64X2I2BDTYQYO4SKI53PWU3HDANCNFSM4HOTXC6Q>
.
--
--
Fabio Miranda Costa
*twitter:* @fabioMiranda
*github:* fabiomcosta
|
@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: I'll create a separate issue for that. |
robbertbrak
added a commit
to robbertbrak/draft-js
that referenced
this issue
May 28, 2019
This should be fixed by #2285 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
To reproduce:
nihao1
and press<enter>
to resolve the compositionResult: 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:
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
The text was updated successfully, but these errors were encountered: