question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: PickerController does not let user select item after moving to Capacitor

See original GitHub issue

Bug 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: Screen Shot 2020-07-27 at 10 45 01 AM

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:closed
  • Created 3 years ago
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
StevieWagcommented, Aug 28, 2020

@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

1reaction
CosmicWebServicescommented, Aug 2, 2020

Unrelated issue found the source. Thank you very much.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found