-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(android): returnPress invoked twice for some returnKeyTypes #5708
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
Closed
EddyVerbruggen
wants to merge
6
commits into
NativeScript:master
from
EddyVerbruggen:issue4461-returnpress
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8f76306
Fixes #4461
EddyVerbruggen 217c55d
Merge branch 'master' into issue4461-returnpress
SvetoslavTsenov c1ceb68
I think we don't need these because TextView never triggers the retur…
EddyVerbruggen e56bdb0
Merge remote-tracking branch 'origin/issue4461-returnpress' into issu…
EddyVerbruggen 5ed121a
Merge branch 'master' into issue4461-returnpress
SvetoslavTsenov 7ebc9e8
Merge branch 'master' into issue4461-returnpress
manoldonev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
hey @EddyVerbruggen -- I might be missing something but I don't think the proposed addition changes the logic of the conditional statement. If
actionIdwasIME_ACTION_UNSPECIFIEDthe conditional would have been truthy because of the 2nd row in the statement so if we progressed till the end we already know it is notIME_ACTION_UNSPECIFIEDand we do not need to check for it explicitly: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.
@manoldonev That's a very valid point. I tested this change with the 3.4 version of code modules where the
actionId === android.view.inputmethod.EditorInfo.IME_NULL || actionId === android.view.inputmethod.EditorInfo.IME_ACTION_UNSPECIFIED ||lines weren't present (both those static properties resolve to0btw) so that worked as expected. In the 4.0 branch this change doesn't make sense anymore as you pointed out.Uh oh!
There was an error while loading. Please reload this page.
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.
@manoldonev I wonder why we need those first 2 lines anyway, because there doesn't seem to be a
returnPressevent being fired on aTextViewanyway.I mean, this is the implementation on
TextField, and there's no implemenation onTextView, and the superclass implementation is empty.So I think we could remove those 2 lines from the
ifstatement and this will work. Thoughts?Uh oh!
There was an error while loading. Please reload this page.
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.
@EddyVerbruggen @hshristov added those lines to fix #5121 (new lines with Japanese IME).
I wonder now whether we can remove the IME_ACTION_GO, IME_ACTION_SEARCH, and IME_ACTION_SEND explicit checks as it seems each of them gets a complementary IME_ACTION_UNSPECIFIED that we will handle -- have to check 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.
New PR proposal for this issue here: #5727