-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Let children onFocus onBlur events in TouchableWithoutFeedback pass through to parent #4078
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
Conversation
| TextInputTestPage.clickMultilineTextInput(); | ||
| assert.ok(TextInputTestPage.getTextInputPrevText().includes('onBlur')); | ||
| }); | ||
|
|
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.
Thanks for adding test coverage! #Resolved
| onResponderRelease: this.touchableHandleResponderRelease, | ||
| onResponderTerminate: this.touchableHandleResponderTerminate, | ||
| onKeyUp: this._onKeyUp, | ||
| onKeyDown: this._onKeyDown, |
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.
There are more events removed in RN61 TouchableWithoutFeedBack.js, for example: onKeyUp and onKeyDown, should we remove those events too? #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.
I think we should, but looks like ReactNative is not doing it? https://github.com/facebook/react-native/blob/master/Libraries/Components/Touchable/TouchableWithoutFeedback.js#L75-L94
Removing it here and adding it to the override list basically means if there's no event handler set on Touchable, use the callbacks on children to handle the events, which I think makes sense for keyUp/Down events, but I'm not sure why they are not in ReactNative.
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.
Oh, is keyUp/Down windows only?
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.
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.
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.
Looks like we are re-routing the events to onPress so we probably shouldn't remove them.
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.
@ddalp just checked there's no keyDown/Up events on TextInput, there's only onKeyPress. We are sending out the onPressed event in _onKeyUp callback, so I think we should keep it as is.
Also added a test to verify keyPress event on TextInput. #Resolved
ddalp
left a comment
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.
![]()
|
When can I expect this fix to be included in a release? |
|
@jagorrin The fix is available now, but the published release it's part of is in beta (0.61-beta). Version 61 will likely stay in beta for at least another week. Do you need this to be part of a previous release? |
|
@kmelmon Would it be possible for this to be cherry-picked into a new 0.60-vnext release? It would be great to be able to have this fix without having to update to the beta version of 0.61 to get it. If so, I have two other fixes that are in the same spot - available only in the 0.61-beta releases, but would be great to have in a new 0.60-vnext release: |
|
@jagorrin all that's required is to submit the cherry-picks as PRs into the 0.60-stable branch. Once checked in, our CI loop will run and publish to npm. If you can prepare the PRs, I'd be happy to review and approve. |
Fixes #3827.
TextInput's onFocus and onBlur callbacks are not functioning, this is because we wrapped RCTTextInput in a TouchableWithoutFeedback, and onFocus onBlur were overridden by TouchableWithoutFeedback.
To fix this we should let OVERRIDE_PROPS do the work and just copy the rest of the children props to parent.
Microsoft Reviewers: Open in CodeFlow