Repository navigation
输入翻译圆点在多行文本框里贴文字末尾:镜像测量复制排版样式量出末尾坐标,量不出来时回落框内侧右下角(#665) - #702
Merged
Merged
Conversation
Co-Authored-By: zhexuancai-uts <261878103+zhexuancai-uts@users.noreply.github.com>
Co-Authored-By: zhexuancai-uts <261878103+zhexuancai-uts@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
输入翻译的圆点一直待在框内侧右下角。这是 ADR-0006 明确否决的方案:那一角被站点的发送、表情、附件、字数等控件占满,视线也要离开刚打完的文字。ADR-0006 定的是圆点贴文字末尾,右下角只作测不出来时的回落。
根因
圆点只有
placeFallback()一种定位。多行文本框的内容是value而不是 DOM 文本,逐段按钮用的Range量不到末尾,必须另建镜像元素来测量,而这个测量还没有。修复
measureTextareaEnd()(src/ui/input-measure.ts)clientWidth减内边距,不算竖向滚动条验证
pnpm test115 个文件 1418 条全绿;pnpm typecheck通过;pnpm build通过;pnpm test:e2e:core91 过、2 跳过Closes #665