-
Notifications
You must be signed in to change notification settings - Fork 289
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
feat: focus events management on Android picker #258
feat: focus events management on Android picker #258
Conversation
This PR would be very useful |
@Naturalclar merge plis |
@Naturalclar merge plis |
js/Picker.js
Outdated
@@ -133,6 +133,7 @@ type PickerProps = $ReadOnly<{| | |||
* </Picker> | |||
*/ | |||
class Picker extends React.Component<PickerProps> { | |||
pickerRef = React.createRef(); |
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.
pickerRef = React.createRef(); | |
pickerRef: React.ElementRef<any> = React.createRef(); |
js/Picker.js
Outdated
blur = () => { | ||
this.pickerRef.current?.blur(); | ||
}; |
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.
blur = () => { | |
this.pickerRef.current?.blur(); | |
}; | |
blur: () => void = () => { | |
this.pickerRef.current?.blur(); | |
}; |
js/Picker.js
Outdated
this.pickerRef.current?.blur(); | ||
}; | ||
|
||
focus = () => { |
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.
focus = () => { | |
focus: () => void = () => { |
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.
@mateusz1913 thanks for the addition!
there are some FlowType errors that is making the CI fail.
Could you check the places I've commented?
0aa95de
to
4dd9b9b
Compare
Done |
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.
LGTM! thank you so much! 🎉
# [1.16.0](v1.15.0...v1.16.0) (2021-05-11) ### Features * focus events management on Android picker ([#258](#258)) ([58ad784](58ad784))
🎉 This PR is included in version 1.16.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Hi @mateusz1913 I got a problem with CI build because the ReactPickerManager.java file has two functions |
Hi @trandinhduc90, without any kind of logs or some error feedback I am not able to help |
This is error when I run CI build |
So it seems that you have some RN old version. Take a look here (these methods in base class): ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManager.java in react-native repo (lines 201 and 212) Method with What RN version do you use? |
I guess that about my react-native version. Currently, I'm using 0.60.5 so maybe I will try to upgrade my react-native version to 0.63 and gave you feedback soon. So thanks for the reply. |
These are commits that included second They are included on 0.61+ branches, so you definitely need to upgrade to at least 0.61 @Naturalclar maybe percentage of devs using old RN versions is low, but it would be good to add small note in README, that focus management is available from 0.61+, if I'll have time I can make it, but maybe someone will be quicker |
Thanks @mateusz1913 , I will try to upgrade to 0.61. So some company still using old react-native version because there don't has the resource to maintain there app. |
I don't know if anyone is still looking at this PR, but using a ref to execute the focus method comes back with an error |
Hi, I want to introduce two features for Android picker in that PR
onBlur
andonFocus
I updated README and example app with example usage of these new features.
Closes #54 #204 #205 #256
and I guess that it should also be ok for #170