Tabbing from ion-input to ion-datetime throws exception
Ionic version: (check one with "x") [x] 2.x
I'm submitting a ... (check one with "x") [x] bug report
Current behavior:
When an <ion-input> is followed by an <ion-datetime> in a list, pressing Tab throws the below exception:
Runtime Error
Error in ./TextInput class TextInput - caused by: nextInput.initFocus is not a function
Stack
TypeError: nextInput.initFocus is not a function
at Form.tabFocus (...\ionic-demo\node_modules\ionic-angular\util\form.js:35:34)
at eval (...\ionic-demo\node_modules\ionic-angular\components\input\input-base.js:153:29)
at SafeSubscriber.schedulerFn [as _next] (...\ionic-demo\node_modules\@angular\core\src\facade\async.js:101:36)
at SafeSubscriber.__tryOrUnsub (...\ionic-demo\node_modules\rxjs\Subscriber.js:223:16)
at SafeSubscriber.next (...\ionic-demo\node_modules\rxjs\Subscriber.js:172:22)
at Subscriber._next (...\ionic-demo\node_modules\rxjs\Subscriber.js:125:26)
at Subscriber.next (...\ionic-demo\node_modules\rxjs\Subscriber.js:89:18)
at EventEmitter.Subject.next (...\ionic-demo\node_modules\rxjs\Subject.js:55:25)
at EventEmitter.emit (...\ionic-demo\node_modules\@angular\core\src\facade\async.js:81:76)
at NextInput.receivedFocus (...\ionic-demo\node_modules\ionic-angular\components\input\native-input.js:167:22)
Expected behavior: Not throwing an exception.
Steps to reproduce:
- Create a new Ionic v2 project
- Paste the below code in
src/pages/home/home.html - Run
ionic serveand open in browser - Click on 'Name'
- Press Tab
<ion-content padding>
<ion-list>
<ion-item>
<ion-label floating>Name</ion-label>
<ion-input type="text"></ion-input>
</ion-item>
<ion-item>
<ion-label floating>Date of Birth</ion-label>
<ion-datetime></ion-datetime>
</ion-item>
</ion-list>
</ion-content>
For some reason, I can't reproduce it on Plunker.
Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):
Your system information:
ordova CLI: 6.4.0
Ionic CLI Version: 2.1.12
Ionic App Lib Version: 2.1.7
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v4.6.1
Xcode version: Not installed
The same thing happens if you use <ion-select> and <ion-checkbox> (and possibly other input components) instead of <ion-datetime>.
It also happens if the <ion-datetime> is the first item, and you press Tab from the last item.
I have same problem with RC3, when tabbing from ion-input to ion-select. Please help Ionic Team. The problem never existed in RC2?
Same, tabbing from input to toggle
error_handler.js:48 EXCEPTION: Error in ./TextArea class TextArea - inline template:0:184 caused by: nextInput.initFocus is not a function
Not sure if related, but when I scroll while having focus in a textarea/ input, that textarea/input gets duplicated while scrolling.
I had this issue with ion-checkbox under 2.0.0-rc.3, but it seems to be fixed in 2.0.0-rc.4! Give it a shot and let us know if it's fixed for the ion-datetime too.
I have never had this issue until I updated to rc4 and now I am getting it on my ion-input, tab or not just leaving the textbox throws the error. However it is a different end error I guess.
Error in ./TextInput class TextInput - caused by: Cannot read property '_platform' of undefined
Ionic Framework: 2.0.0-rc.4-201612192257 Ionic Native: ^2.2.12 Ionic App Scripts: 0.0.48 Angular Core: 2.2.1 Angular Compiler CLI: 2.2.1 Node: 7.2.1 OS Platform: Windows 10 Navigator Platform: Win32 User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36
This seems to be in the nightly version only, I went back to just RC4 and it works again.
Same here with a <ion-input> followed by a <ion-datetime>
Runtime Error
Error in ./TextInput class TextInput - caused by: nextInput.initFocus is not a function
TypeError: nextInput.initFocus is not a function
at Form.tabFocus (http://localhost:8100/build/main.js:9295:34)
at http://localhost:8100/build/main.js:107010:29
at SafeSubscriber.schedulerFn [as _next] (http://localhost:8100/build/main.js:38411:36)
at SafeSubscriber.__tryOrUnsub (http://localhost:8100/build/main.js:1327:16)
at SafeSubscriber.next (http://localhost:8100/build/main.js:1276:22)
at Subscriber._next (http://localhost:8100/build/main.js:1229:26)
at Subscriber.next (http://localhost:8100/build/main.js:1193:18)
at EventEmitter.Subject.next (http://localhost:8100/build/main.js:4464:25)
at EventEmitter.emit (http://localhost:8100/build/main.js:38391:76)
at NextInput.receivedFocus (http://localhost:8100/build/main.js:44069:22)
Ionic Framework: 2.0.0-rc.4
Ionic Native: 2.2.11
Ionic App Scripts: 0.0.47
Angular Core: 2.2.1
Angular Compiler CLI: 2.2.1
Node: 4.2.6
OS Platform: Linux 4.4
Navigator Platform: Linux x86_64
User Agent: Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.23 Mobile Safari/537.36
I'm seeing this as well on -rc.4.
ionic serve --lab tab pressed to move next input element throw this error. I also have the same problem. Anybody have the solution to resolve it.
I'm getting this on 2.0.0-rc.5
When tabbing from an ion-input to an ion-select
Also having this issue in version: 2.0.0-rc.3
Yep. Problem is still there in -rc.5.
Also having this issue in version: 2.0.0-rc.3
Can anyone fix this or is there any workaround?
It's still there in -rc.5 if you run the app in mobile browser (iOS 10, both chrome and safari in my case). Other platform/browser not tested yet.
Just so you know (I don't mean to bump this thread, only thought it was important)
This also happens if you are using the Keyboard.hideKeyboardAccessoryBar(false) (AKA, if you're using the accessory bar to navigate inputs and the input attempts to select a ion-datetime).
I'm also seeing this as well :/
I had the same issue until I used the inputs inside of a form. https://ionicframework.com/docs/v2/resources/forms/
I got same issue now.
Also having this issue in version: 2.2.1
I'm having this issue too, is there a workaround? Maybe implementing a stub method for nextInput.initFocus?
Your system information:
Cordova CLI: 6.5.0
Ionic Framework Version: 2.0.0-rc.3
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.0.0
ios-deploy version: 1.9.0
ios-sim version: 5.0.11
OS: macOS Sierra
Node Version: v7.0.0
Xcode version: Xcode 8.1 Build version 8B62