sagemathinc / cocalc

CoCalc: Collaborative Calculation in the Cloud
https://CoCalc.com
Other
1.16k stars 216 forks source link

French Firefox: Writing a Circumflex in the rich text editor causes the cursor to jump #6459

Open e-dervieux opened 1 year ago

e-dervieux commented 1 year ago

When in the chat, if I try to write a word with a circumflex while using the "fancy text" editor, it writes the letter alright, but the next char that I enter makes the circumflexed letter disapears and the cursor move to the begining of the message.

Exemple :

If I want to write "J'en suis sûr":

J'en suis s     (press '^')
J'en suis s^   (press 'u')
J'en suis sû   (press 'r')
J'en suis sr    (cursor is now before 'J')

This is very annoying, as circumflexed letter are pretty common in French. And the circumflex is also used in LaTeX formulas to make superscript.

Additional notes

This bug does not happen when using the Markdown editor.

This bug happens whether using the MacBook keyboard, or an external one in French disposition (French or French - PC keyboards, in MacOS settings) but does NOT happen if using a QWERTY disposition as (American, in macOS setting)

Configuration

williamstein commented 1 year ago

I'll of course look into this in detail at some point soon, hopefully. In the meantime, a quick question -- do you see any problems when you try out the demo here: https://www.slatejs.org/examples/richtext

e-dervieux commented 1 year ago

I just checked and the issue is not present on the link that you gave above, while I could repeat it on Cocalc.

I am very new with Cocalc, but could that be a shortcut-linked issue? I.e. the '^' command would trigger some kind of shortcut within Cocalc that would in turn lead to weird behaviours?

williamstein commented 1 year ago

Unfortunately, I am not able to reproduce this problem on CoCalc.

I used MacOS Ventura 13.1 (Macbook Pro 2021), with French disposition (French). I can type exactly what you suggest but the cursor doesn't jump for me.

I won't be able to fix this if I can't reproduce it.

@haraldschilly you're European -- do you see anything similar if you somehow try say a German keyboard layout?

e-dervieux commented 1 year ago

I tested it again and I can reproduce it very easily...

I thought it may be linked to the fact that we're self-hosting cocalc but I had the same issue with cocalc.com so I dug further and found something interesting: I have the issue on Firefox (109.0.1 (64 bits)), but not using Safari (Version 16.3 (18614.4.6.1.5)) or Chrome (Version 110.0.5481.77 (Build officiel) (x86_64)).

Hope this helps!

EDIT: here is an example of what happens when typing the word "sûr".

output

EDIT 2: the issue is not present using the same Firefox version, but on Windows (10.0.17763) or with another version (110.0) on Linux (Kubuntu 22.04.2 LTS). I will try tomorrow with other MacBooks to narrow the issue...

williamstein commented 1 year ago

Thanks for the additional insight.. I can confirm that I can reproduce this in Firefox, and that it doesn't happen in Google Chrome.

I've changed the title of the ticket accordingly and added the Firefox label.

e-dervieux commented 1 year ago

Ok, just for your information, I could reproduce it on a MacBookPro M1 (2020) using Firefox 109.0 and MacOS Ventura 13.0.

Also, I noticed that if writing in the middle of a word or text block - as opposed to "at the end of the line" - the newly written character just "jumps" of one position forward. So it seems that the observed "return to the beginning of the line" behaviour is just a jump forward of one position, modulo the length of the already written message (see the GIF below for a visual ilustration). I dont't know if it helps though... Also, the the "move one forward" behaviour seems to not happen when the next character entered is a space.

output

(In the example I pressed : '^' + 'o' + ' ' + 'backspace' + '^' + 'o' + 'r' + 'backspace')

williamstein commented 1 year ago

This is all helpful. Also, the fact I can reliably reproduce it due to your instructions means there is certainly hope!