Bug 274702

Summary: compositionend Event Not Triggered When Clearing contentEditable Element
Product: WebKit Reporter: Hyungu Kang <gusrn1423>
Component: HTML EditingAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: ap, mike, rniwa, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: Safari 17   
Hardware: All   
OS: iOS 17   

Hyungu Kang
Reported 2024-05-24 19:47:56 PDT
Test Environment: •macOS: Version 14.4.1 •Safari: Version 17.4.1 (19618.1.15.11.14) •iPhone: iOS 17.4.1 •Safari: Version 17.4.1 Mobile/15E148 Safari/604.1 Description: - In contentEditable elements, when input is cleared using methods like elem.innerHTML = '', the compositionend event does not fire as expected. This issue affects text input handling and disrupts the expected behavior of composition events. Steps to Reproduce: 1. Create a contentEditable element in a webpage. 2. Start typing text in the contentEditable element to initiate a composition (e.g., using an IME for Japanese). (Currently, Korean does trigger composition event https://bugs.webkit.org/show_bug.cgi?id=274700) 3. While the composition is ongoing, clear the content using JavaScript: elem.innerHTML = ''. 4. Observe that the compositionend event does not fire. Expected Result: - The compositionend event should be triggered when the content of a contentEditable element is cleared, ensuring proper handling of composition termination.
Attachments
Hyungu Kang
Comment 1 2024-05-24 20:03:03 PDT
Side Effect: After clear the input using innerHTML, if a new compositional string that can combine with the previous string is entered, the last character that was cleared reappears in the input field.
Radar WebKit Bug Importer
Comment 2 2024-05-31 19:48:13 PDT
Note You need to log in before you can comment on or make changes to this bug.