Repository navigation
fix(ui): TextArea 接收滚轮,内容超出时可滚动 - #19
Draft
xiaoyumuxi wants to merge 1 commit into
Draft
xiaoyumuxi wants to merge 1 commit into
xiaoyumuxi wants to merge 1 commit into
Conversation
多行输入框此前不处理滚轮,只能随光标滚动,超出高度的内容无法用鼠标浏览。 现在指针位于 TextArea 上时,滚轮先滚动它自己的行;已经到达所需方向的末端时, 事件交还给页面,与浏览器行为一致。 - components: TextareaLayout.Wheel 报告是否真的移动,超出判断只看上次绘制的文本区域。 - ui: Page.Wheel 在下拉框之后、其他滚动路由之前检查 TextArea。 - 测试:components.TestTextareaWheelScrollsUntilItsEnd 覆盖区域外、顶端、末端和正常滚动。 Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.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.
背景
多行输入框(
ui.TextArea)不处理鼠标滚轮,只能随光标移动而滚动。Lithe 的本地历史规则列表因此无法用鼠标浏览超出高度的内容(Lithe 侧临时改为按行数撑开列表高度绕过,见 Lithe-IDEA #1938 之后的提交)。改动
components/textarea.go:TextareaLayout.Wheel(event)。指针在上次绘制的文本区域内时滚动它,并报告是否真的移动;已到达所需方向的末端、或内容不超出时返回 false。ui/page.go:Page.Wheel在下拉框之后、其他滚动路由之前检查 TextArea。返回 false 时事件继续交给页面,即外层滚动区域滚动。components/textarea_wheel_test.go:覆盖区域外、顶端向上、正常向下、末端四种情况。不在本 PR 范围内
desktop/go.mod的replace。验证
go test ./components/ ./ui/ -count=1(macOS)go test ./components/ -run TestTextareaWheel -vgofmt -l components uiLithe 桌面端的完整集成验证尚未在此分支上进行。
🤖 Generated with Claude Code