-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Fabric] Add onSubmitEditing and clearTextOnSubmit #12746
Conversation
@@ -786,6 +791,11 @@ void WindowsTextInputComponentView::OnKeyUp( | |||
lParam |= 0x40000000; // bit 30 | |||
lParam |= 0x80000000; // bit 31 always 1 for WM_KEYUP | |||
|
|||
// check to see if shift is released | |||
if (args.Key() == winrt::Windows::System::VirtualKey::Shift) { |
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 works but is there a better way to know if the shift key is pressed down? Didn't want to add the rest of the keys until I got confirmation on this :)
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.
You shouldn't try to keep track of the key state in WindowsTextInputComponentView. Instead you should query the state as needed.
The KeyboardSource object has a method to get the key state of a key, you should pass that to the ShouldSubmit function.
Description
Adds onSumbitEditing and clearTextOnSubmit to TextInput
Type of Change
Why
TextInput parity
What
Adds onSumbitEditing event to TextInput and keeps track of if the shift key is pressed.
Screenshots
Playground-composition_QPMHOlSOIT.mp4
Testing
tested locally
Changelog
no
Microsoft Reviewers: Open in CodeFlow