react-native-windows
react-native-windows copied to clipboard
Focus ring is displayed even for programmatic focus
Problem Description
In #6220, we switched the NativeUIManager to xaml::FocusState::Keyboard for UIManager.focus
calls.
This is not desirable. xaml::FocusState::Keyboard should only be used when the user actually intends to focus with the keyboard.
Steps To Reproduce
N/A
Expected Results
N/A
CLI version
npx react-native --version
Environment
npx react-native info
Target Platform Version
No response
Target Device(s)
No response
Visual Studio Version
No response
Build Configuration
No response
Snack, code example, screenshot, or link to a repository
No response
I put some comments on the PR associated with this: https://github.com/microsoft/react-native-windows/pull/10266#issuecomment-1188047816
We should get a clear answer on what the correct behavior is. @AgneLukoseviciute Can you follow up to get that clarified?
I put some comments on the PR associated with this: #10266 (comment)
We should get a clear answer on what the correct behavior is. @AgneLukoseviciute Can you follow up to get that clarified?
From looking into it and the new comments from Eric and Andrew, I also think that we should be using programmatic focus here. FocusState::Keyboard would be the right approach if we're assuming that an app would handle the keyboard events in js and be moving focus in response to that, but since we have native keyboarding I think it's more likely it'd be used to programmatically change focus in response to say clicking an edit button and moving it to the textbox to be edited. I'll go ahead and approve the PR.