bug: ion-picker column options overlapping
See original GitHub issueBug 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:
- Created 4 years ago
- Comments:6 (2 by maintainers)
Top 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 >
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
Hi liamdebeasi, Can we hold this issue,Because I will go out for a few days,Thank you
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.