Skip to content

Conversation

@TatianaKapos
Copy link
Contributor

@TatianaKapos TatianaKapos commented Feb 16, 2024

Description

Adds onSumbitEditing and clearTextOnSubmit to TextInput

Type of Change

  • New feature (non-breaking change which adds functionality)

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

@TatianaKapos TatianaKapos requested a review from a team as a code owner February 16, 2024 18:42
lParam |= 0x80000000; // bit 31 always 1 for WM_KEYUP

// check to see if shift is released
if (args.Key() == winrt::Windows::System::VirtualKey::Shift) {
Copy link
Contributor Author

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 :)

Copy link
Contributor

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.

@TatianaKapos TatianaKapos changed the title [Fabric] Add onSubmitEditing with shift and clearTextOnSubmit [Fabric] Add onSubmitEditing and clearTextOnSubmit Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants