Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

iOS: clear and fill on a field over 120 characters leave old text behind (`estimatedDeleteCount` caps at 120)

Abierto
#3,851 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@KrzysztofMoch ya está trabajando en esto.

Desde el 22/10/2026.

  • #3908 de @KrzysztofMoch — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
76/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
ios, typescript
Área
mobile, testing

Línea de trabajo

Start in RunnerTests+TextEntry.swift and read clearTextInput and estimatedDeleteCount; then inspect the repair call in RunnerTests+TextTyping.swift. Reproduce with a 501-character value and verify that clear leaves the field empty and fill replaces the old value. The issue suggests bounding repeated delete bursts and using the existing single-burst behavior when the value cannot be read.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug ready-for-agent

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

  1. A SwiftUI TextEditor (or any text field) holding 501 characters.
  2. fill <field> "": 381 characters remain.
  3. 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 (e35d8de8).

Cause

RunnerTests+TextEntry.swift:

private func estimatedDeleteCount(for element: XCUIElement) -> Int {
  let valueText = normalizedElementText(element.value)
  let base = valueText.isEmpty ? 24 : (valueText.count + 8)
  return max(24, min(120, base))
}

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.

Lenguaje dominante
TypeScript
Estrellas
5.1k
Forks
339
Merge medio
11 h 54 min
PR fusionados (30 d)
745

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de callstack/agent-device

Todos los issues de callstack/agent-device

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.