Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#3,851 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@KrzysztofMoch がすでに取り組んでいます。

2026年10月22日 から。

  • #3908 @KrzysztofMoch による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
ios, typescript
領域
mobile, testing

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
TypeScript
スター
5.1k
フォーク
339
平均マージ
11時間 59分
マージ済み PR(30日)
736

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

callstack/agent-device のほかの issue

callstack/agent-device の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。