Repository navigation
fix: 修复任务选项下拉菜单被裁切的问题 - #356
Merged
MistEO merged 1 commit intoSep 22, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
你好——我发现了 1 个问题
AI 代理提示词
请处理此次代码审查中的评论:
## 单独评论
### 评论 1
<location path="src/components/OptionEditor.tsx" line_range="1089-1092" />
<code_context>
};
const handleListboxKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {
+ if (event.key === 'Tab') {
+ // 在默认 Tab 导航前回到原 DOM 位置,兼容 Shift+Tab。
+ closeAndFocusTrigger();
+ return;
+ }
+ if (options.length === 0) return;
</code_context>
<issue_to_address>
**问题 (bug_risk):** Tab 和 Shift+Tab 处理程序会将焦点移至触发器,但不会调用 preventDefault,因此浏览器的默认 Tab 导航随后仍会执行,并将焦点移至下一个或上一个可聚焦元素,而不是让焦点停留在触发器上。
**触发条件:** 任一下拉菜单打开时按下 Tab 或 Shift+Tab。
**建议修复:** 在关闭下拉菜单并将焦点移至触发器之前调用 `event.preventDefault()`,或者明确实现预期的下一个/上一个焦点转换。
</issue_to_address>Original comment in English
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/components/OptionEditor.tsx" line_range="1089-1092" />
<code_context>
};
const handleListboxKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {
+ if (event.key === 'Tab') {
+ // 在默认 Tab 导航前回到原 DOM 位置,兼容 Shift+Tab。
+ closeAndFocusTrigger();
+ return;
+ }
+ if (options.length === 0) return;
</code_context>
<issue_to_address>
**issue (bug_risk):** The Tab and Shift+Tab handlers focus the trigger but do not call preventDefault, so the browser's default Tab navigation runs afterward and moves focus to the next or previous focusable element instead of leaving focus on the trigger.
**Triggers:** When Tab or Shift+Tab is pressed while either dropdown is open.
**Suggested fix:** Call `event.preventDefault()` before closing and focusing the trigger, or explicitly implement the intended next/previous focus transition.
</issue_to_address>
Owner
|
来个图瞅瞅? |
Contributor
Author
Contributor
|
来了来了 |
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.


任务选项下拉菜单超出任务卡片边界时,会被父容器的 overflow 裁切,导致部分选项无法显示。将普通下拉菜单和搜索下拉菜单通过 Portal 渲染到 document.body,使用固定定位,并根据视口空间调整方向、宽度和可滚动高度。
验证:
pnpm build通过。pnpm test通过(现有 6 项测试)。pnpm tauri build --no-bundleWindows release 构建通过。git diff --check通过。Sourcery 总结
将任务选项下拉菜单改为基于 Portal 的视口自适应浮层,避免菜单被容器裁切并保持稳定的交互行为。
Bug 修复:
功能改进:
Original summary in English
Summary by Sourcery
将任务选项下拉菜单改为基于 Portal 的视口自适应浮层,避免菜单被容器裁切并保持稳定的交互行为。
Bug Fixes:
Enhancements: