Bug 208835

Summary: Safari doesn't preserve user selection upon updating input value with the same value programmatically
Product: WebKit Reporter: Viacheslav Moskalenko <jason.rammoray>
Component: HTML EditingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: ahmad.saleem792, bradrini, rniwa, simon.fraser, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: BrowserCompat, InRadar
Version: Safari 13   
Hardware: Mac   
OS: macOS 10.15   
Attachments:
Description Flags
Demonstrating the issue in Safari none

Viacheslav Moskalenko
Reported 2020-03-09 15:03:33 PDT
Created attachment 393078 [details] Demonstrating the issue in Safari Details: * an input field has some value (say "initial value") * a user clicks somewhere in the middle of the input field (say, right after "l") * the input field's value is getting updated programmatically with the same value after n seconds Expected: The user's selection (cursor position) doesn't change. Actual: A cursor jumps to the end of the input's value (right after "e"). Demo: https://jsbin.com/pipefoluha/1/edit?html,js,output Notes: The cursor positions is correctly handled in: * Chrome [80.0.3987.132 (Official Build) (64-bit), macOS 10.15.3 (19D76)] * Firefox [73.0.1 (64-bit), macOS 10.15.3 (19D76)]
Attachments
Demonstrating the issue in Safari (919.97 KB, video/quicktime)
2020-03-09 15:03 PDT, Viacheslav Moskalenko
no flags
Radar WebKit Bug Importer
Comment 1 2020-03-09 15:07:48 PDT
Ahmad Saleem
Comment 2 2022-12-16 03:37:13 PST
I am not able to reproduce the jump issue in Safari 16.2 and Safari Technology Preview 160 but the field does not get focus like Chrome Canary 110 and Firefox Nightly 110 while showing the caret at "iIn" (I as Caret) position, which might be separate issue. Can someone else confirm and we mark this bug appropriately while using this test case for other bug tracking purpose? Thanks!
Ryosuke Niwa
Comment 3 2022-12-16 16:10:23 PST
Doesn't reproduce anymore.
Note You need to log in before you can comment on or make changes to this bug.