Closed jaredtibs closed 7 years ago
Anyone?
Update:
I was able to find a solution to this thanks to a stack overflow post: http://stackoverflow.com/questions/38651770/how-can-i-get-real-elment-by-node-id-react-native
The code I used:
handleFormFocus(e, component) {
let targetComponent = ReactNativeComponentTree.getInstanceFromNode(component);
let inputRef = targetComponent._currentElement.props.fieldRef;
switch (inputRef) {
// now i can perform actions depending on what input field specifically was focused
}
}
Cheers
PS: The require line for ReactNativeComponentTree can look like this:
var ReactNativeComponentTree = require('react/lib/ReactNativeComponentTree');
Hi,
I'm running into trouble figuring out how to reference a specific one of my InputFields when the onFocus Form handler is triggered. I tried adding an onFocus function to the the individual InputFields themselves but it's not triggering.
Here's my code:
Doing the following does not work:
Any help at all would be greatly appreciated. Thanks!