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: ion-picker column options overlapping

See original GitHub issue

Bug Report

Ionic version:

[x] 4.3

Current behavior: AddEventListener to catch ionPickerColChange event, when a Column item changed, filter another column, but those itmes overlapping below is screen shot https://ibb.co/wKsPGWx

Expected behavior:

I try set selectedIndex = 0,still not work Steps to reproduce:

Related code:

    const picker =  await this.pickerCtrl.create({
      buttons: [{
        text: 'cancel',
      }, {text: 'ok', handler: (opt) => {
          const p = picker.getColumn('project')
              .then(data => {
                const index = data.selectedIndex;
                const grade = this.projectItems.items[index].grade;
                const param = {xmname: opt['project'].text,
                    grade: grade,
                    subject: opt['subject'].text,
                    tizuName: opt['tizu'].text,
                    tizuEnName: opt['tizu'].value,
                    fullHostName: window.location.hostname
                  };
                this.checkIsBackScore(param);
              });
        }}],
      columns: [
        {
          name: 'project',
          selectedIndex: 0,
          options: this.projects
        },
        {
          name: 'subject',
          selectedIndex: 0,
          options: this.subjects
        },
        {
          name: 'tizu',
          selectedIndex: 0,
          options: this.tiZus
        }
      ],
      // mode: 'ios'
    });
    picker.addEventListener('ionPickerColChange', async (event: any) => {
      const data = event.detail;
      if (data.name === 'project') {
        const curIndex = data.selectedIndex;

        this.subjects = [];
        Promise.all((data.options[curIndex] as PickerColumnOption).value.map((item) => {
          this.subjects.push({text: item.name, value: item.items, duration: 0, selected: true, disabled: false});
        }));

        this.tiZus = [];
        if (this.subjects.length > 0) {
          Promise.all(this.subjects.map((item) => {
            this.tiZus.push({text: (item as TizuItem).tizu_name, value: (item as TizuItem).tizu_enname, duration: 0,
              selected: true, disabled: false});
          }));
        }

        const columns = [];
        columns.push({name: 'project', selectedIndex: curIndex, options: this.projects, optionsWidth: '100px'});
        columns.push({name: 'subject', selectedIndex: 0, options: this.subjects, optionsWidth: '100px'});
        columns.push({name: 'tizu', selectedIndex: 0, options: this.tiZus, align: 'right', optionsWidth: '100px'});
        picker.columns = columns;


      } 
    });
    picker.present();

Other information:

Ionic info:

insert the output from ionic info here

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
pppp0836commented, Jun 6, 2019

Hi liamdebeasi, Can we hold this issue,Because I will go out for a few days,Thank you

0reactions
ionitron-bot[bot]commented, Jul 19, 2019

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

bug: ion-picker column options overlapping #18575 - GitHub
Bug Report Ionic version: [x] 4.x Current behavior: AddEventListener to catch ionPickerColChange event, when a Column item changed, ...
Read more >
ionic framework - ion picker options overlaps - Stack Overflow
First of all, I found that the problem is that you put the options with an array, I mean you don't put them...
Read more >
Display Buttons and Columns for ion-picker on Ionic Apps
A Picker is a dialog that displays a row of buttons and columns underneath. It appears on top of the app's content, and...
Read more >
Responsive date & time picker documentation for Angular
Browse the full developer documentation and learn how to use the Mobiscroll Date & Time to build responsive UIs in Angular and Ionic...
Read more >
How To Create an Overlay Image Title - W3Schools
Learn how to create an image overlay title on hover. Image Overlay Title. Hover over the image to see the overlay effect. ......
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