Skip to content

fix(input): 圆点位置没有任何钳制,文字末尾的坐标直接当成圆点坐标 → 多行文本框滚动后末尾落在可见区外,圆点被画到框外、压住页面其他内容(#669) - #717

Merged
Teeeeeeeerry merged 2 commits into
mainfrom
fix/669-dot-clamp-visible
Oct 7, 2026
Merged

Teeeeeeeerry merged 2 commits into
mainfrom
fix/669-dot-clamp-visible

Conversation

@Teeeeeeeerry

Copy link
Copy Markdown
Owner

问题

#665 让多行文本框里的圆点贴上文字末尾之后,文字一长、框内滚动,末尾的坐标就落到框的可见区域之外,圆点跟着被画到框外,压在页面其他内容上。

根因

圆点位置直接取镜像测量给出的末尾坐标,代码里没有任何钳制或可见区判断。

修复

  • 文字末尾滚出框的可见区域(边框以内、滚动条以外)时,圆点钳到离它最近的可见边缘。按 ADR-0006,不隐藏,也不换样式。
  • 滚回来后沿用已有的滚动重算,重新贴末尾。
  • 可见区域的计算从回落位置里抽出来,回落与钳制共用一份。单行文本框的横向滚动留给 输入翻译:单行文本框的圆点贴文字末尾,含横向滚动(#633) #666 接同一套钳制。

验证

  • TC-E2E-136:多行文本框打 12 行后滚到顶、滚到中间,圆点都在框的可见区域内,仍然显示、样式不变、焦点还在框里;滚回底,圆点回到“line 12”末尾(画布量字宽作真值,误差不超过 2px)。修复前滚到顶时圆点在框底下方 142px。
  • pnpm test 115 个文件 1423 条全部通过;pnpm typecheck 通过;pnpm test:e2e:core 93 条通过、2 条跳过。

Closes #669

Teeeeeeeerry and others added 2 commits October 7, 2026 12:36
…面其他内容(#669)

文字末尾滚出框的可见区域(边框以内、滚动条以外)时,圆点钳到离它最近的
可见边缘,不隐藏、不换样式(ADR-0006);滚回来后按原有的滚动重算重新贴
末尾。可见区域的计算从回落位置里抽出,回落与钳制共用一份。

Co-Authored-By: zhexuancai-uts <261878103+zhexuancai-uts@users.noreply.github.com>
Co-Authored-By: zhexuancai-uts <261878103+zhexuancai-uts@users.noreply.github.com>
@Teeeeeeeerry
Teeeeeeeerry merged commit 69d7cfe into main Oct 7, 2026
6 checks passed
@Teeeeeeeerry
Teeeeeeeerry deleted the fix/669-dot-clamp-visible branch October 7, 2026 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

输入翻译:文字末尾滚出可见区域时圆点钳到框的可见边缘(#633)

1 participant