bug: PickerController does not let user select item after moving to Capacitor
See original GitHub issueBug Report
Ionic version:
[ ] 4.x [x] 5.x
Current behavior: I have a two-column PickerController which after moving to capacitor from Cordova it no longer let’s users select and throws an error:
⚡️ ------ STARTUP JS ERROR ------
⚡️ [error] - {}
⚡️ TypeError: engine.selectionStart is not a function. (In 'engine.selectionStart()', 'engine.selectionStart' is undefined)
⚡️ URL: capacitor://localhost/common-es2015.js
⚡️ common-es2015.js:187:34
I have not changed any pickerController code and I have no references to selectionStart
Expected behavior: User can change the selection on the pickerController
Steps to reproduce:
On iOS open a pickerController and notice the ability to change the item is “frozen”.
Related code:
const picker = await this.pickerController.create({
columns: this.getColumns(2, 11, options),
buttons: [
{
text: 'Cancel',
role: 'cancel'
},
{
text: 'Confirm',
handler: (value) => {
console.log(`Got Value ` + JSON.stringify(value));
if (value['col-1'].text === 'Never') {
this.taptic.selection();
this.expireLabelText = 'Never';
} else if (value['col-0'].text === '') {
this.taptic.notification({type: 'error'});
alert('Please set a number value!');
} else {
this.taptic.selection();
if (parseInt(value['col-0'].text) > 1) {
this.expireLabelText = value['col-0'].text + ' ' + value['col-1'].text;
} else {
this.expireLabelText = value['col-0'].text + ' ' + (value['col-1'].text).slice(0, -1);
}
}
}
}
]
});
await picker.present();
Ionic info:
Ionic:
Ionic CLI : 6.10.1 (/usr/local/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 5.3.1
@angular-devkit/build-angular : 0.901.12
@angular-devkit/schematics : 9.1.12
@angular/cli : 9.1.12
@ionic/angular-toolkit : 2.3.0
Capacitor:
Capacitor CLI : 2.3.0
@capacitor/core : 2.3.0
Utility:
cordova-res : 0.15.1
native-run : 1.0.0
System:
NodeJS : v12.14.1 (/usr/local/bin/node)
npm : 6.14.7
OS : macOS
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (1 by maintainers)
Top Results From Across the Web
How do i fix File Picker error in Capacitor 4 - Stack Overflow
The app crashes after i select a mp4 file and i am getting this error, any help? E/AndroidRuntime: FATAL EXCEPTION: main Process: com.rovespier....
Read more >Camera API Plugin: Capacitor and Cordova for Ionic Apps
The Capacitor/Cordova Camera API plugin lets users take photos, capture video, and choose images from the system's image library directly from Ionic apps....
Read more >Troubleshooting Android Issues | Capacitor Documentation
This error occurs when some Cordova or Capacitor plugin has old android support dependencies instead of using the new AndroidX equivalent. You should...
Read more >How to Manage Photo Library Permission in iOS - Swift Senpai
When Apple introduced limited photo access in iOS 14, some iOS developers were not so happy about it, it seems like Apple was...
Read more >Adding Google Maps to Your Capacitor Application - YouTube
Google Maps is a popular solution to display maps with a mobile application. Yet, until recently, it was extremely difficult to integrate ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@CosmicWebServices would be awesome if you share what caused the issue on your side. We have the same issue from one day to another with out ion-datetime. Would really appreciate your feedback
Unrelated issue found the source. Thank you very much.