You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: ion-picker allows selection of disabled options between enabled options #26840
I have searched for existing issues that already report this problem, without success.
Ionic Framework Version
v4.x
v5.x
v6.x
v7.x
Nightly
Current Behavior
When using an ion-picker with a list of options that begins with 1+ enabled, contains 1+ disabled options in the middle, then ends with 1+ enabled options, the selector doesn't correctly auto-select an enabled option. Further the selector allows the user to select a disabled option.
Expected Behavior
Users should not be able to select a disabled PickerColumnOption.
PickerColumn should auto-select a valid option if the user attempts to choose a disabled option.
Steps to Reproduce
Create a simple ion-picker with a set of options - recommend 7 options to easily see the issue.
Set the options as follows:
0: disabled = false
1: disabled = false
2: disabled = true
3: disabled = true
4: disabled = true
5: disabled = false
6: disabled = 6
Attempt to select a disabled option.
*Note, you may need to adjust the CSS for .picker-opt-disabled in order to see the disabled options more easily.
Thank you for the issue, I'm able to replicate this. Dragging the picker column with the mouse allows you to select the disabled items. It seems the number of items or columns doesn't matter, as long as there is at least one enabled item on both sides of the disabled item(s).
When using items like this:
Enabled
Disabled
Enabled
Disabled
... item 2 is selectable, but not item 4.
I'm able to replicate it in core, meaning it likely happens in all frameworks. It also happens with both controller pickers, and the upcoming inline pickers feature.
It looks like the best workaround is to rearrange things to place all disabled items at the end of the column.
changed the title [-]bug: ion-picker doesn't support disabled options between enabled options[/-][+]bug: ion-picker allows selection of disabled options between enabled options[/+]on Feb 22, 2023
Thanks for the request. In Ionic 8 we are adding a new inline picker which resolves this issue. The work required to add this was completed in #28689, so I am going to close this.
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.
Activity
averyrousseau commentedon Feb 22, 2023
Thank you for the issue, I'm able to replicate this. Dragging the picker column with the mouse allows you to select the disabled items. It seems the number of items or columns doesn't matter, as long as there is at least one enabled item on both sides of the disabled item(s).
When using items like this:
... item 2 is selectable, but not item 4.
I'm able to replicate it in core, meaning it likely happens in all frameworks. It also happens with both controller pickers, and the upcoming inline pickers feature.
It looks like the best workaround is to rearrange things to place all disabled items at the end of the column.
[-]bug: ion-picker doesn't support disabled options between enabled options[/-][+]bug: ion-picker allows selection of disabled options between enabled options[/+]feat(picker): add inline picker (#28689)
liamdebeasi commentedon Dec 13, 2023
Thanks for the request. In Ionic 8 we are adding a new inline picker which resolves this issue. The work required to add this was completed in #28689, so I am going to close this.
ionitron-bot commentedon Jan 12, 2024
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.