Open SuperKXT opened 2 years ago
@SuperKXT can you please describe the use case when you trigger focus method? I know we don't pass ref to TouchableOpacity
, that's why it's not working. I'm just interested is it used on web or on mobile?
It is used on mobile. As this was a while ago, I can not recall the exact problem I was trying to solve.
I just tried your example, it seems that method focus
is presented on all platforms (if cases works fine), but it actually works only on web, e.i. nothing happens when calling it on mobile. on my sample project it even causes crashes.
Do you still have an issue with this functionality?
I don't understand what you mean. It works on TouchableOpacity, but not on Button.I have tweaked the example so it actually calls the focus method for both TouchableOpacity and Button. It seems to be crashing on button presses on all platforms.
I've checked the example one more time. I added onFocus
listener to TouchableOpacity
and after calling focus
method via ref onFocus
callback was called only on web. That what I meant. focus
method is presented on JS side, but it seems to be it is not implemented for native mobile platforms for TouchableOpacity
component.
what was your use case of using focus
method? I'm asking because for now it seems TouchableOpacity
component doesn't provide working functionality for focus
method on mobile platforms (despite it is presented in JS interface). just want to understand what problem we're trying to solve before making any changes
If I remember correctly I was trying to focus the submit button if you press next on the last form input.
π Bug Report
The Button component can not be focused on programmatically. The focus method is not available. The Button uses TouchableOpacity which does have a focus method.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The expected behavior would be to have the focus method available on the component.
Link to runnable example or repository (highly encouraged)
snack demo
UI Kitten and Eva version
Environment information