ji-devs / draft-canvas

https://jewish-interactive.github.io/draft-canvas
MIT License
0 stars 0 forks source link

Direction flipped when on the same line #3

Closed dakom closed 6 years ago

dakom commented 6 years ago

Writing Hebrew and English on the same line results in the direction being flipped:

screen shot 2018-01-29 at 10 57 10

jpuri commented 6 years ago

This seems to be trouble with the way DraftJS is generating content. When english characters are added in the line they are added towards the end of the line in content that editor generates. And Hebrew characters are added towards the beginning.

If you can detail the exact required behavior I can try to override default DraftJS behavior and achieve that.

dakom commented 6 years ago

@corinnewo - when you're back in, can you detail the desired behavior in a case like this? I think it might be good to post some examples of how you expect the text to look when there's a mixture of Hebrew/English text in several scenarios (e.g. first Hebrew then English, reversed, split over lines, etc.)

corinnewo commented 6 years ago

Hi Jyoti I have attached an example of how we would like the language to be used. If you start in English, it starts on left, then if you write in Hebrew, it writes the word from right to left, but it is kept within the sentence. If I then write again in English, it continues to the right of the word.

If I start typing a new line with Hebrew, it is automatically right-aligned, but if I insert an English word, it adds it to the left of the Hebrew word.

If you would like to 'zoom' to discuss, I am happy to discuss on Monday. Thanks! Corinne

hebrew and english mixed

dakom commented 6 years ago

We just saw - English then Hebrew seems fine. Starting with Hebrew and then switching to English is where it gets problematic