hackmdio / codimd

CodiMD - Realtime collaborative markdown notes on all platforms.
https://hackmd.io/c/codimd-documentation
GNU Affero General Public License v3.0
9.35k stars 1.06k forks source link

Controlling the cursor buggy in iOS #1195

Closed retemirabile closed 4 years ago

retemirabile commented 5 years ago

On iOS (Safari, Chrome, Firefox), the cursor behaves unreliably, on iPad the standard two-finger gesture on the keyboard can’t place the cursor, the writing area jumps unexpectedly, the keyboard sometimes doesn’t open. See this scree recording: http://ak-u.de/yd

What you see there: writing, trying to move the cursor with two-finger gestures (visible when letters disappear from keyboard).

After that:

→ Unfortunately, this comes down to HackMD/CodiMD not being fully usable on iOS.

Affected browsers

Any ideas?

JJ-OpusVL commented 5 years ago

Having similar issues controlling the CodeMD cursor on an iPad using an external bluetooth keyboard.

From the keyboard, the arrow keys do not move the cursor, which also means that text selection is not possible.

However, the CodeMirror editor does support iOS, both using the touchscreen and with an external keyboard.

jackycute commented 5 years ago

Hi @JJ-OpusVL I think CodeMirror still have problem supporting iOS external keyboard, you can find out bunch of issues here: https://github.com/codemirror/CodeMirror/search?p=1&q=ios+is%3Aissue&type=Issues https://github.com/codemirror/CodeMirror/search?q=ipad+is%3Aissue&type=Issues

Could you share any test with us?

JJ-OpusVL commented 5 years ago

Here's a basic test using an external keyboard with CodeMirror 5.46.0 - https://jsfiddle.net/5a4cqbzg/9/

Browser is Safari on iOS 12.1

Working

Not working

None of these key presses work on the current CodiMD.

I've also tested the patch from https://github.com/codemirror/CodeMirror/issues/5073 that fixes "Select All" on the iPad internal keyboard (CSS addition) and confirmed that it works - https://jsfiddle.net/L1gbpfoa/

jackycute commented 5 years ago

There is an option called "inputStyle" in CodeMirror and we use "textarea" which is bad for supporting iOS but have better IME input experience.

The default of inputStyle on mobile now is contenteditable which is the mode you're testing: https://github.com/codemirror/CodeMirror/blob/c18094eab567211f73050beaa5c3fcceb2133888/src/edit/options.js#L77

Seems we need to do more investigation to find out the solution to make both IME and external keyboard work.

Thank you for reporting and sharing information with us @JJ-OpusVL

jackycute commented 4 years ago

The keyboard arrow behaviors fixes have been confirmed on iOS 13, please upgrade to iOS 13. Close this now.