I'm currently working with NativeScript ("nativescript-vue": "^2.5.0")
and testing on iOS 13
"tns-android": {
"version": "6.0.0"
},
"tns-ios": {
"version": "6.0.1"
}
I am attempting to focus on a TextField when a button is tapped. The current setup looks like this
<GridLayout dock="top" columns="auto,*,auto" width="70%" rows="auto,auto">
<Label text.decode="" horizontalAlignment="left" row="0" rowSpan="2" col="0" />
<Label text="USER" horizontalAlignment="left" row="0" col="1" class="m-l-3" />
<Label :text="userEditBtnText" @tap="userEditTap()" horizontalAlignment="right" row="0" rowSpan="2" col="2" class="btnEdit"/>
<TextField ref="userid" text="@username" :editable="userEdit" horizontalAlignment="left" row="1" col="1" class="m-l-3"/>
</GridLayout>
Here is the code for @tap="userEditTap()"
userEditTap(){
this.userEdit = true;
this.userEditBtnText="SAVE";
this.$refs["userid"].focus();
}
and I am receiving the following console error:
JavaScript error: file: node_modules/@nativescript/core/application/application.ios.js:312:26 JS ERROR Error: NativeScript encountered a fatal error: TypeError: this.$refs["userid"].focus is not a function. (In 'this.$refs["userid"].focus()', 'this.$refs["userid"].focus' is undefined)
Any suggestions or input on this issue are welcome!