Skip to content
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

[bug]Add Chinese text after the element #1829

Closed
HereSinceres opened this issue May 9, 2018 · 9 comments
Closed

[bug]Add Chinese text after the element #1829

HereSinceres opened this issue May 9, 2018 · 9 comments

Comments

@HereSinceres
Copy link
Contributor

HereSinceres commented May 9, 2018

Do you want to request a feature or report a bug?

bug

What's the current behavior?

slate v: 0.33.5
slate-react v:0.12.5

1

What's the expected behavior?

slate-react v:0.12.4 is correct

@ScripterSugar
Copy link

ScripterSugar commented May 13, 2018

I found a same bug when i type korean with slate after i add mark over text and type the words.

@yunwuxin
Copy link
Contributor

@WDFS me too

@yunwuxin
Copy link
Contributor

@kommen @justinweiss @rgrove

@qingxiangchayun
Copy link

+1

@ScripterSugar
Copy link

ScripterSugar commented Jul 17, 2018

I solved this problem using very awkward solution. Right after the user adds mark while selection is collapsed, I made the editor to put one white space at the front of the selection anchor so that white space is marked as well. After that, if user does any action except typing korean, (like select other area or type english/special characters or select other mark/block/inline tags etc...) my Editor deletes that pre-inserted white space. Doing so solves the weird behavior of editor appearing when user types korean.

(This solution have nothing to do with chinese problem. it only solves the korean typing problem.)

@zhujinxuan
Copy link
Contributor

The strange thing is: when we try to input Chinese with input method, the tag disappears...

I am trying whether we shall prevent key when event.key === null

@zhujinxuan
Copy link
Contributor

I think I find the problem.

IME will trigger composition events. Current slatejs will try to re-render by setState. But we need

  1. handle composition event to get currect update
  2. re-mount instead of re-render because composition includes uncontrolled doms

@yunwuxin
Copy link
Contributor

@ianstormtaylor any solutions?

@ianstormtaylor
Copy link
Owner

Closing in favor of #2368, if you think this is unrelated let me know and we can reconsider.

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

No branches or pull requests

6 participants