-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Improve NumericUpDown and AutoCompleteBox focusability #13376
Conversation
Does it work with Shift+Tab or any other way of back-focus to previous focusable element? |
No, the PR does not address that scenario. I'll look into it. |
I've used the ideas in this as a base to manage something for a basic control I'm working on, and the back navigation aspect can be handled to an extent with
in the OnGotFocus override. |
I've refactored my version to account for a few oversights, and sometimes overthinking things, and come to this version.
I'm not sure what you'd need to change to account for the ButtonSpinner that wraps the TextBox in the Simple Theme. I suspect nothing actually, but haven't looked into it. |
* Delegate focus to TextBox * Port FocusChanged from AutoCompleteBox to NumericUpDown * Improve focus with NumericUpDown and ButtonSpinner bindings --------- Co-authored-by: Max Katz <maxkatz6@outlook.com>
What does the pull request do?
Makes the NumericUpDown control focusable. Focus is delegated its child TextBox.
What is the current behavior?
NumericUpDown is not focusable.
What is the updated/expected behavior with this PR?
Makes it possible to focus the NumericUpDown control and when that happens focus is delegated to the containing TextBox control.
How was the solution implemented (if it's not obvious)?
Checklist
I tried adding unit tests for this behavior but failed. It boils down to the visual tree not being setup correctly during test so the calls to TextBox.Focus() will fail under test, but works in a normal app scenario.
If it is possible to make a working test then please advise me how to proceed. The RealFocus test service is not enough for this test case.
Breaking changes
Don't think so.
Fixed issues
Fixes #8069
Fixes #13339
Fixes #11152
Fixes #5016
Fixes #12921