Add runtime warning for unsupported keyboardType #15778
Add runtime warning for unsupported keyboardType #15778Nitin-100 wants to merge 2 commits intomicrosoft:0.82-stablefrom
Conversation
|
We dont do this for the 10s (100s?) of other properties that do not work on windows. Android/iOS also do not generally warn if you use a platform specific property on those platforms. Ex: using tabIndex on iOS does not cause any kind of warning, it's just silently ignored. The code also appears to run in production, so it's causing additional work in production apps. Also, this will cause debug output spam, which apps may want to have more control over. - If every component outputs to debug then it becomes hard to see anything. |
Thanks, I have explained the PM team as they were asking for it. |
Description:
Adds a runtime warning when developers use the
keyboardTypeprop on TextInput in React Native Windows Fabric. This prop is not yet functional due to Windows platform limitations with the Touch Keyboard and windowless RichEdit controls.What
Added a warning mechanism in
WindowsTextInputComponentView.cppthat:keyboardTypeis set to any value other than"default"Files Changed
vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cppCode Added
And the warning check in
updateProps:Why
The
keyboardTypeprop is accepted by the TextInput component but has no effect on Windows Fabric. Without this warning, developers may not realize the prop isn't working, leading to confusion when the Touch Keyboard layout doesn't change as expected on iOS/Android.Technical Background
ITextInputScopeto determine keyboard layoutHow
The warning is implemented using:
std::unordered_setto track emitted warnings (prevents spam)OutputDebugStringAto output to Visual Studio debug consoleWhen Warning Appears
The warning is shown:
keyboardTypemounts or updatesWarning Message Example
Testing
keyboardType="number-pad"Test Code
Microsoft Reviewers: Open in CodeFlow