-
Notifications
You must be signed in to change notification settings - Fork 1.2k
keyboardtype parity to paper in fabric #15359
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
base: main
Are you sure you want to change the base?
keyboardtype parity to paper in fabric #15359
Conversation
6b080f9 to
882dede
Compare
| HCURSOR m_hcursor{nullptr}; | ||
| std::chrono::steady_clock::time_point m_lastClickTime{}; | ||
| std::vector<facebook::react::CompWindowsTextInputSubmitKeyEventsStruct> m_submitKeyEvents; | ||
| std::string m_keyboardType{}; |
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.
We should not be storing copies of props on the component. The value already exists in the prop object, lets not duplicate memory.
acoates-ms
left a comment
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.
This PR does nothing. It just duplicates the prop storage, and doesn't implement the functionality of this prop.
Yes, it is not complete and I was just trying to explore but windowless RichEdit controls do not support InputScope. This feature requires XAML controls (Paper architecture) or a future Windows platform API that supports windowless input scope hints. |
|
Can't use TSF by using InputScope APIs (ITfContextOwner, ITfInputScope) but require a window handle (HWND), but Fabric is windowless. |
Description
Type of Change
Why
The
keyboardTypeprop is a standard React Native TextInput property that allows developers to specify which keyboard type to display (e.g., numeric, email, phone pad). This prop was already defined and parsed in Fabric's WindowsTextInputProps but was not being applied to the native component, creating a parity gap with Paper (XAML) implementation where it is fully functional.Current Status:
This change is part of the ongoing effort to achieve feature parity between Paper and Fabric architectures for TextInput components.
What
This PR implements proper handling of the
keyboardTypeprop in Fabric's TextInput component:Files Modified:
WindowsTextInputComponentView.h
updateKeyboardType()method declarationm_keyboardTypemember variable to store the keyboard typeWindowsTextInputComponentView.cpp
updateKeyboardType()method to store the keyboard type valueupdateProps()to detect prop changesonMounted()for initial setupImplementation Approach:
Since Fabric uses windowless RichEdit controls with TextServices (not XAML controls), and
Windows.UI.Xaml.Input.InputScopeis not available in Composition architecture, this implementation stores the keyboard type value to maintain the prop contract. The keyboard behavior is primarily handled by the system's Input Method Editor (IME).Supported Keyboard Types:
default,numeric,number-pad,decimal-pad,email-address,phone-pad,urlweb-searchsecureTextEntryis enabledScreenshots
keyboardtype.mp4
Verify that:
updateKeyboardType()Changelog
Should this change be included in the release notes: Yes
Summary for release notes:
Added support for
keyboardTypeprop in Fabric TextInput to achieve parity with Paper implementation. This standard React Native prop now properly handles keyboard type specification (numeric, email, phone, etc.) in Fabric architecture.Microsoft Reviewers: Open in CodeFlow