-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
[Blur & Focus] Support relinquishing focus from multiple views via co… #2203
Conversation
[view resignFirstResponder]; | ||
} | ||
} | ||
} |
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 should be able to do something like [subview endEditing:YES]
instead of doing the complete traversal. Also can remove the uiManager parameter since self == uiManager.
UIView *view = uiManager.viewRegistry[reactTag];
if (view) {
[view endEditing:YES];
} else {
// Recurse through the shadow hierarchy when the shadow view has no backing UIView
for (RCTShadowView *subview in [shadowView reactSubviews]) {
[self endEditingForShadowView:subview.reactTag viewRegistry:viewRegistry];
}
}
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.
@ide Makes perfect sense, i'll make the changes, test and commit.
- Using endEditing vs resignFirstResponder as it is more efficient.
@ide Made the changes you requested and tested them in my app and everything seems to work great, let me know if you think anything else is needed. |
I like this 😄 👍 |
@brentvatne not sure what went wrong with the build? |
@josebalius - if #113 works (assuming we can resolve the issue you mentioned in #113 (comment)) is this still needed? |
@josebalius updated the pull request. |
@spicyj would you mind taking a look at this pull request? It's been a while since the last commit was reviewed. |
@josebalius Can you please indicate whether this PR is still needed? See the comment by Brent Vatne:
|
It's been a while since the last commit was reviewed and the labels show this pull request needs review. Based on the blame information for the files in this pull request we identified @nicklockwood as a potential reviewer. Could you take a look please or cc someone with more context? |
I think this can probably be closed guys. |
Thanks for looking @josebalius. I assume this was resolved in #113?
|
…ntainer - #113
This adds the ability to call
this.refs.parentView.blur()
and blur any active text fields inside the view. It will first try to blur the field (already supported) and if the field is not found as an "active" text field, it will transverse the view andresignFirstResponder
for each of them.I am currently using it in my app and works well.