Bug 269922

Summary: Add API to programatically manipulate text composition
Product: WebKit Reporter: dcordoneanu
Component: HTML EditingAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Major CC: apolostudioapps, ap, fantasai.bugs, megan_gardner, rniwa, vitor.roriz, webkit-bug-importer, wenson_hsieh, woodlxf00
Priority: P2 Keywords: InRadar
Version: Safari 17   
Hardware: All   
OS: All   

dcordoneanu
Reported 2024-02-22 07:46:16 PST
Right now, in Safari, on both MacOS and iOS, trying to end a composition state or manipulate it is impossible. In our specific scenario, we have a hidden textarea which is focused when the user needs to add some text and has the selection synced programatically based on user action. However, for CJK scenarios, it is impossible to achieve the same behaviour as the textarea has when it is manipulated directly by the user. I think it would be highly beneficial for different scenarios to be able to have an API that allows a developer to programatically: - change the composition range - manipulate undetermined and determined text - decide when a composition should end I've also tried some different approaches to end a composition as it can be seen in the following fiddles: https://jsfiddle.net/6h93zkf4/1/ https://jsfiddle.net/6h93zkf4/2/ Thanks!
Attachments
Radar WebKit Bug Importer
Comment 1 2024-02-29 07:47:41 PST
Ryosuke Niwa
Comment 2 2024-02-29 15:29:22 PST
Sounds like this is an ask for EditContext.
dcordoneanu
Comment 3 2024-03-07 00:31:28 PST
Hello, Indeed it could be linked to the EditContext. Is there a status on your side regarding the implementation of the EditContext API for MacOS/iOS? Thank you!
Note You need to log in before you can comment on or make changes to this bug.