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

(Mobile Support)Trix editor does not support Chinese input keyboard on iOS #396

Closed
cndaniel opened this issue Apr 25, 2017 · 6 comments
Closed
Labels

Comments

@cndaniel
Copy link

cndaniel commented Apr 25, 2017

Steps to Reproduce
  1. please enable Chinese simplified Pinyin keyboard in iOS system preference
  2. Open trix-editor.org in Safari
  3. Clear all placeholder text in editor first. Use Chinese simplified Pinyin keyboard to type. Like 'nihao'(then click the first two characters on the selection line on the keyboard above) will normally turning the latin pinyin into two Chinese characters(你好) meaning Hello. Now, Trix is recording only pinyin after selection, the system keyboard is supposed to return the encoded Chinese characters, which the trix seems to escape them and force them to clear. The cursor will then jump to the front waiting for new input. Therefore, unless a user put a space in the beginning, trix will never record Chinese Character by using Chinese simplified Pinyin input method.
Details
  • Trix version: trip-editor.org
  • Browser name and version: Safari 10
  • Operating system: iOS 10

screenshot

First I test the Chinese Pinyin input on Safari address text-area. (No cursor clearing and wiping)
then I test in trix editor, I can't write a complete sentence. Each time I tried to write down some characters, trix will force the cursor to the front.
trix

@cqpx
Copy link

cqpx commented Jul 17, 2017

Also confirmed on macOS Safari 10.1.1 for both Chinese and Japanese input methods.
After bisected the commits, I found that this issue started from 0.9.2.
0.9.0 don't have this issue but it has a different one.

@javan
Copy link
Contributor

javan commented Jul 17, 2017

Thanks @cqpx. Does it only occur when the editor is empty?

@cqpx
Copy link

cqpx commented Jul 19, 2017

Sort of, please see my screenshot.

When I clear the text area with Delete key, it will leave a strange vertical line at the beginning of the text area.

When I start typing from the strange vertical line with either empty or filled editor,

  1. It will move cursor back to the beginning when I pressed Enter to confirm my selection (it should stay at the end so that I can continue typing)
  2. When I continue typing after the above step, the first character was swallowed and cursor moved to the beginning again

untitled

@biallo
Copy link

biallo commented Aug 18, 2017

@javan

The problem should be here

if nodeIsBlockStartComment(node)

When enter Chinese (Japanese should be the same), the walker.currentNode is not complete in Safari(I have test on OSX, iOS should be the same).

I'm trying to find a solution, but the progress is slow, so I write down the problem and hope to get some ideas or help.

Here is the log I collected:

In Chrome
// Step 1: Type 'a'

node <div>​…​</div>​
trix.js:10055 nodeIsBlockStartComment(node) false

trix.js:10054 node <!--block-->
trix.js:10055 nodeIsBlockStartComment(node) true

trix.js:10054 node "a&nbsp;"
trix.js:10055 nodeIsBlockStartComment(node) false

trix.js:10054 node <div>​…​</div>​
trix.js:10055 nodeIsBlockStartComment(node) false

trix.js:10054 node <!--block-->
trix.js:10055 nodeIsBlockStartComment(node) true

trix.js:10054 node "a&nbsp;"
trix.js:10055 nodeIsBlockStartComment(node) false

// Step 2: Type space, get a '啊'

trix.js:10054 node <div>​…​</div>​
trix.js:10055 nodeIsBlockStartComment(node) false

trix.js:10054 node <!--block-->
trix.js:10055 nodeIsBlockStartComment(node) true

trix.js:10054 node "啊&nbsp;"
trix.js:10055 nodeIsBlockStartComment(node) false

trix.js:10054 node <div>​…​</div>​
trix.js:10055 nodeIsBlockStartComment(node) false

trix.js:10054 node <!--block-->
trix.js:10055 nodeIsBlockStartComment(node) true

trix.js:10054 node "啊&nbsp;"
trix.js:10055 nodeIsBlockStartComment(node) false

In Safari
// Step 1: Type 'a'

node <div>​…​</div>​
trix.js:10055 nodeIsBlockStartComment(node) false

trix.js:10054 node <!--block-->
trix.js:10055 nodeIsBlockStartComment(node) true

trix.js:10054 node "a&nbsp;"
trix.js:10055 nodeIsBlockStartComment(node) false

trix.js:10054 node <div>​…​</div>​
trix.js:10055 nodeIsBlockStartComment(node) false

trix.js:10054 node <!--block-->
trix.js:10055 nodeIsBlockStartComment(node) true

trix.js:10054 node "a&nbsp;"
trix.js:10055 nodeIsBlockStartComment(node) false

// Step 2: Type space, get a '啊'
// The <! - block -> was lost

trix.js:10054 node <div>​…​</div>​
trix.js:10055 nodeIsBlockStartComment(node) false

trix.js:10054 node "啊&nbsp;"
trix.js:10055 nodeIsBlockStartComment(node) false

trix.js:10054 node <div>​…​</div>​
trix.js:10055 nodeIsBlockStartComment(node) false

trix.js:10054 node "啊&nbsp;"
trix.js:10055 nodeIsBlockStartComment(node) false

@biallo
Copy link

biallo commented Aug 18, 2017

By the way, I found another problem that might be related to this.

When you enter a lot of Chinese, the editor may lose focus when you execute undo.
If you continue to enter text at this time, they do not appear in the editor. But when you click the input area to get focus again, after you press any key, the content you just entered will appear in the editor as a lot of letters.

This problem occurs in both Safari and Chrome.

@stale
Copy link

stale bot commented Sep 17, 2018

This issue has been automatically marked as stale after 90 days of inactivity. It will be closed if no further activity occurs.

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

No branches or pull requests

4 participants