-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Description
Prerequisites
- I have read the .I agree to follow the .I have searched for that already report this problem, without success.To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
Ionic Framework Version
v8.x
Current Behavior
By scrolling the picker the value is not changed and the event is not fired on iOS devices with iOS 16 (used iPhone 8 Plus).
Expected Behavior
The event should fire and the value should change.
Steps to Reproduce
- create a blank angular ionic project
- Insert code as the documentation in the home.page.html,home.poge.ts and home.page.scss files: https://ionicframework.com/docs/api/picker#picker-in-modal
- To check the bug add in home.page.ts one line to the onIonChange function:
onIonChange(event: CustomEvent) {
console.log("onIonChange fired!", event.detail.value) // ADD THIS LINE
this.currentValue = event.detail.value;
}
- Try on an Android device: you see in the console the ionChange event fired when value change
- Try on an iOS device: nothing is fired when value change
Code Reproduction URL
https://github.com/losciur/ionic-bug-ion-column-picker
Ionic Info
Ionic:
Ionic CLI : 5.4.16 (/Users/simon/.npm/_npx/864a9e3c2cd0cf50/node_modules/ionic)
Capacitor:
Capacitor CLI : 6.1.0
@capacitor/core : 6.1.0
Utility:
cordova-res : 0.15.4
native-run : 2.0.0
System:
NodeJS : v22.3.0 (/usr/local/Cellar/node/22.3.0/bin/node)
npm : 10.8.1
OS : macOS Unknown
Additional Information
The code is from this closed issue: #29480
The issue was closed without it having been resolved, so I'm reopening it, because it is happening on an iPhone that has iOS 16 and should be supported, since these devices don't receive iOS 17.
I investigated the issue and it comes down to the elementsForPoint not returning the ion-picker-column-option on this devices for some reason. So I made a simple patch which would make it work, but it's probably a bit expensive:
/core/src/components/picker-column/picker-column.tsx 379:
let newActiveElement = elementsAtPoint.find((el) => el.tagName === 'ION-PICKER-COLUMN-OPTION');
if(!newActiveElement) {
const contains = (rect,x,y)=>rect.x <= x && rect.y <= y && x <= rect.x + rect.width && y <= rect.y + rect.height
newActiveElement = [...el.children].find(x=>contains(x.getBoundingClientRect(),centerX,centerY))
}
if (activeEl !== undefined) {
this.setPickerItemActiveState(activeEl, false);
}
Activity
Raphael-Schulz commentedon Jul 25, 2024
We are confronting the same issue as described in this Post in our React application. We need to go back to Ionic v7.x for now.
For us the problem is showing up in the
IonDateTimecomponent displayed in a Modal (which is using the IonPicker under the hood). We tried it on different devices and in the browser. We can confirm that it is only happening on iOS 16.x as described in this PR. For our case it is 100% necessarry to have the issue fixed as a lot of our users have these "older" device models.jfcere commentedon Sep 26, 2024
Before this gets closed for inactivity, is there any intention from the Ionic team to prioritize this regression problem?
WheelyWonka commentedon Feb 10, 2025
Any news on that subject ? Thanks
vilhelmjosander commentedon Feb 21, 2025
We have the exact same issue on iOS 16.7.x as well. Desperately need this to be fixed since thousands of our users have an iPhone 8 which cannot install iOS 17.
JoaoHCopetti commentedon Mar 14, 2025
I'm using Vue and it's not being fired for any platform.
Inspecting with Vue Devtools I found out that it's not emitting the event, but rather accepting a prop
ion-change, this is what I did in order to work:Edit: It seems it got fixed on Ionic 8.5.0, now it emits the correct
@ion-changeeventShaneK commentedon May 7, 2025
Hello! Is this still an issue in 8.5.0?
Simon54 commentedon May 7, 2025
Still happening, still not fixed.
ShaneK commentedon May 7, 2025
Very interesting, I cloned your example repo and I'm running it in an iOS 16.4 emulator and it appears to be working? I think there was a bug in these versions of iOS that don't let you use the web inspector, but I added an alert to onIonChange and it appears to work as expected. Is it exactly iOS 16 that this is happening for you in?
Screenshot-2025-05-07.at.14.31.41.mp4
52 remaining items