-
-
Notifications
You must be signed in to change notification settings - Fork 363
feat(AutoFill): auto select when item length equal 1 #6947
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
input输入Enter时,如候选项唯一,直接选中 当焦点从AutoFill移出时,如GetDisplayText(Value)对应的内容与input中的内容不符则清空Value和Input
|
Thanks for your PR, @braia123. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
Reviewer's GuideThis PR introduces a blur-based invalid input clearing feature for the AutoFill component, controlled by a new parameter, and enhances the Enter-key logic to auto-select the sole dropdown suggestion. Sequence diagram for AutoFill blur and invalid input clearingsequenceDiagram
participant User
participant AutoFill
participant JS
User->>AutoFill: Blur event (onblur)
AutoFill->>JS: GetInputValue()
JS-->>AutoFill: inputValue
AutoFill->>AutoFill: Compare inputValue with GetDisplayText(Value)
alt Input invalid
AutoFill->>JS: setValue (clear input)
AutoFill->>AutoFill: CurrentValue = default
end
Sequence diagram for AutoFill Enter key auto-selectionsequenceDiagram
participant User
participant AutoFillJS
participant AutoFill
User->>AutoFillJS: Press Enter
AutoFillJS->>AutoFillJS: Check dropdown items
alt Only one suggestion
AutoFillJS->>AutoFillJS: Trigger click on suggestion
AutoFillJS->>AutoFill: EnterCallback
else Multiple suggestions
AutoFillJS->>AutoFillJS: Select active suggestion
AutoFillJS->>AutoFill: EnterCallback
end
Updated class diagram for AutoFill componentclassDiagram
class AutoFill {
+float RowHeight
+bool IsClearOnInvalid
+Task TriggerFilter(string val)
+Task OnBlur()
+Task<string> GetInputValue()
}
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.
|
@microsoft-github-policy-service agree |
Signed-off-by: braia123 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6947 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 740 740
Lines 31875 31875
Branches 4469 4469
=========================================
Hits 31875 31875
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@braia123 感谢提交 PR 稍后我邀请你一下您,这样 PR 就不需要 fork 到自己仓库里,直接在我们的仓库里创建 PR 节省好几个步骤 |
input输入Enter时,如候选项唯一,直接选中
当焦点从AutoFill移出时,如GetDisplayText(Value)对应的内容与input中的内容不符则清空Value和Input显示内容
Link issues
fixes #6948
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Add blur validation and auto-selection behavior to AutoFill: clear invalid inputs on blur with a configurable flag, support a blur event callback, and auto-select the only dropdown item when pressing Enter or NumpadEnter.
New Features:
Enhancements: