You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
iOS: clear and fill on a field over 120 characters leave old text behind (estimatedDeleteCount caps at 120) #3851
On iOS, fill <target> "" and fill <target> "<text>" delete at most 120 characters of the existing value. A longer value is only partly cleared, so a clear leaves text behind and a fill appends to the leftover instead of replacing it.
Reproduce
A SwiftUI TextEditor (or any text field) holding 501 characters.
fill <field> "": 381 characters remain.
Put 501 characters back, then fill <field> "<500 chars>": the field ends at 1261 characters and the fill fails text entry verification.
Seen on agent-device 0.21.28, iOS 26.5 simulator. The same code is on main (e35d8de).
clearTextInput sends that many delete keys once and never checks whether the field is empty afterwards. With 501 characters:
clear: 501 - 120 = 381 left
fill: 381 + 500 = 881, then the repair in RunnerTests+TextTyping.swift (clearTextInput(app: app, repairTarget) before typeText(expectedText)) deletes another 120 and retypes 500: 881 - 120 + 500 = 1261
Suggested fix
In clearTextInput, re-read the value after each delete burst and keep going until it reads empty, with a bounded number of rounds so a field that never reports its value can't loop forever. Size each burst from the value just read (keep a per-burst cap if long typeText strings are slow). When the value can't be read (secure fields, bullet-only values), fall back to the current single burst, or to select-all then delete.
Triage: bug; actionable without more input from you. Confirmed on main: estimatedDeleteCount in RunnerTests+TextEntry.swift caps one delete burst at 120, and clearTextInput never re-reads the value, so a longer value is cleared only partly and fill appends to the remainder. The fix follows your suggestion: re-read after each burst until the field is empty, with a bounded number of rounds, and keep the current fallback when the value is unreadable. An agent can pick this up.
Activity
thymikee commentedon Oct 21, 2026
Triage: bug; actionable without more input from you. Confirmed on main:
estimatedDeleteCountinRunnerTests+TextEntry.swiftcaps one delete burst at 120, andclearTextInputnever re-reads the value, so a longer value is cleared only partly andfillappends to the remainder. The fix follows your suggestion: re-read after each burst until the field is empty, with a bounded number of rounds, and keep the current fallback when the value is unreadable. An agent can pick this up.fix(ios): clear a long text value wherever the caret lands (callstack…
fix(ios): clear a long text value wherever the caret lands (callstack…
fix(ios): clear a long text value wherever the caret lands (callstack…
fix(ios): clear a long text value wherever the caret lands (callstack…
fix(ios): clear a long text value wherever the caret lands (callstack…
fix(ios): clear a long text value wherever the caret lands (#3908)