-
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
Support onSubmitEditing event #3423
Conversation
m_controlKeyDownRevoker = control.KeyDown( | ||
winrt::auto_revoke, [=](auto &&, winrt::KeyRoutedEventArgs const &args) { | ||
if (args.Key() == winrt::VirtualKey::Enter && !args.Handled()) { | ||
auto instance = wkinstance.lock(); |
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.
auto instance = wkinstance.lock(); [](start = 10, length = 34)
this will be more readable:
if (auto instance = wkinstance.lock()) {
} #Resolved
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.
HstringToDynamic(control.as<winrt::PasswordBox>().Password())); | ||
} | ||
if (!m_updating && instance != nullptr) { | ||
instance->DispatchEvent( |
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.
Don't raise the event if multline flag is specified #WontFix
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 is covered in checking if the keydown is already handled above. True for Multiline since enter key is used for text editing.
In reply to: 335120678 [](ancestors = 335120678)
winrt::auto_revoke, [=](auto &&, winrt::KeyRoutedEventArgs const &args) { | ||
if (args.Key() == winrt::VirtualKey::Enter && !args.Handled()) { | ||
auto instance = wkinstance.lock(); | ||
folly::dynamic eventDataSubmitEditing = {}; |
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.
eventDataSubmitEditing [](start = 25, length = 22)
The event has three parameters: {nativeEvent: {text, eventCount, target}}. I don't know if android/iOS provides eventCount or not. #WontFix
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 also don't send eventCount for onEndEidting event, I want to keep the behavior same for onSubmitEditing for now.
In reply to: 335124057 [](ancestors = 335124057)
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.
#3083
Microsoft Reviewers: Open in CodeFlow