-
Notifications
You must be signed in to change notification settings - Fork 42
fix: improve text field focus behavior with context menu #545
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
1. Add contextMenuVisible property to TextField to track menu visibility 2. Update SearchEdit's editting property to include contextMenuVisible state 3. Modify EditPanel to show border when context menu is visible 4. Add onClosed handler to context menu to maintain text field focus Log: Fixed text field losing focus when context menu is closed Influence: 1. Test opening context menu in text fields and search inputs 2. Verify text field maintains focus after closing context menu 3. Check that search edit layout remains consistent during context menu usage 4. Test border visibility in text fields when context menu is open 5. Verify search icon positioning in SearchEdit during context menu operations fix: 改进带上下文菜单的文本框焦点行为 1. 为 TextField 添加 contextMenuVisible 属性以跟踪菜单可见性 2. 更新 SearchEdit 的 editting 属性以包含上下文菜单可见状态 3. 修改 EditPanel 在上下文菜单可见时显示边框 4. 添加上下文菜单关闭时的处理程序以保持文本框焦点 Log: 修复关闭上下文菜单时文本框失去焦点的问题 Influence: 1. 测试在文本框和搜索输入中打开上下文菜单 2. 验证关闭上下文菜单后文本框保持焦点 3. 检查搜索编辑布局在上下文菜单使用期间保持一致 4. 测试上下文菜单打开时文本框的边框可见性 5. 验证上下文菜单操作期间 SearchEdit 中搜索图标的位置 PMS: BUG-315333
Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: linuxdeepin/dtkdeclarative#545
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR improves text field focus behavior by introducing a contextMenuVisible state, updating SearchEdit’s editting logic to include it, adjusting EditPanel border visibility, and enforcing focus retention when the context menu closes. Sequence diagram for context menu closing and focus retention in TextFieldsequenceDiagram
participant User as actor
participant TextField
participant ContextMenu
User->>TextField: Right-click to open context menu
TextField->>ContextMenu: Show menu
ContextMenu->>TextField: onClosed event
TextField->>TextField: forceActiveFocus()
Class diagram for updated TextField, SearchEdit, and EditPanel propertiesclassDiagram
class TextField {
+alertText
+alertDuration
+showAlert
+contextMenuVisible
}
class EditPanel {
+showBorder
}
class SearchEdit {
+placeholder
+editting
}
TextField "1" --> "1" EditPanel : background
SearchEdit <|-- TextField : inherits
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, mhduiy, wjyrich The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: linuxdeepin/dtkdeclarative#545
state
Log: Fixed text field losing focus when context menu is closed
Influence:
usage
operations
fix: 改进带上下文菜单的文本框焦点行为
Log: 修复关闭上下文菜单时文本框失去焦点的问题
Influence:
PMS: BUG-315333
Summary by Sourcery
Improve TextField focus behavior by tracking context menu visibility, preserving focus on menu close, and updating SearchEdit states accordingly.
New Features:
Bug Fixes:
Enhancements: