Bug 224932 - AX: compositionend not fired when there is no selection in accent menu
Summary: AX: compositionend not fired when there is no selection in accent menu
Status: REOPENED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: Safari 14
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-04-22 08:03 PDT by Benny Martinson
Modified: 2022-11-28 12:54 PST (History)
7 users (show)

See Also:


Attachments
compositionend not fired (1.24 MB, video/quicktime)
2022-11-28 12:54 PST, Benny Martinson
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Benny Martinson 2021-04-22 08:03:36 PDT
See http://jsfiddle.net/c46koq57/ for a repro with these steps.

Repro instructions:

Put the cursor in the contenteditable box in the fiddle.
Long-press a vowel, until the accent menu opens.
Arrow right to select a replacement.
Arrow left to unselect that replacement.
Now type any character.
Expected behavior: A compositionend event should be dispatched when a character is typed (which will be logged to the console).

Actual behavior: No compositionend event is dispatched, which can cause IME handling code to get into a bad state since there was a compositionstart event. This does work correctly if we have a replacement selected before typing a new character. 

The bug is not reproducible in Chrome or Firefox.
Comment 1 Radar WebKit Bug Importer 2021-04-22 08:03:48 PDT
<rdar://problem/77018817>
Comment 2 Ahmad Saleem 2022-11-26 17:59:17 PST
I just tried this in Safari 16.1 and when I long press "a" and follow all instruction "compositionend" event does get fired.

Just wanted to post testing result. Thanks!
Comment 3 Ryosuke Niwa 2022-11-28 12:28:29 PST
This seems to be working on Safari 16.1.
Comment 4 Benny Martinson 2022-11-28 12:51:10 PST
I'm still seeing the bug in Safari Version 16.1 (17614.2.9.1.13, 17614), macOS 12.6.1.
Comment 5 Benny Martinson 2022-11-28 12:54:20 PST
Created attachment 463768 [details]
compositionend not fired

See the attached video.
Comment 6 Ryosuke Niwa 2022-11-28 12:54:28 PST
Oh I see. The issue is that the typed character is never processed. As a result, compositionend doesn't fire until the selection is moved elsewhere.