Composition issues in Firefox on Mac with widgets

I’m seeing some issues with composition in Firefox on Mac while using composition near a widget. The browser seems to get confused when moving the cursor, inserting extra characters and other odd behaviour. I am not a regular IME user, but I’m fairly certain this behaviour is incorrect, and is not the same when doing the same thing on a line with no widget.

Using this example, and using Japanese - Romaji input source with a virtual keyboard to make it easier to follow (the behaviour is the same with a physical keyboard), I recorded the following:

cm6-firefox-widget

For comparison, here is the same on a line without a widget:

cm6-firefox

I was able to reproduce something similar on Linux, and found a fix that hopefully also covers what you are seeing here.

1 Like

Thanks for fixing that. Unfortunately, trying the same example again (it appears as though Try CodeMirror has view 6.9.3), I’m afraid it now seems differently broken on Mac. When entering a second composition, the down arrow key gets stuck when trying to move down to an emoji in the menu, and pressing the left arrow key then causes characters to appear and other oddness.

cm6-firefox-mac-again

Indeed. I was testing with special character widgets, which, because they aren’t zero-length, didn’t show this issue. Attached patch seems to help with zero-length widgets.

1 Like

I regret to say that in Firefox on Mac the situation seems unchanged.

Are you still testing on codemirror.net/try? Because that patch hasn’t been released yet.

No, I was testing on a local copy with the patch.

Odd. If I put your original test case in a local test page, and on MacOS Firefox type Chinese text after it, I don’t see anything going wrong.

I’ll double check and try again when I next have access to a Mac with a local dev environment, which will probably be Thursday.