-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: ion-picker allows selection of disabled options between enabled options #26840
Comments
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. |
Issue number: resolves #24905, resolves #26840, resolves #15710 --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> The current picker is only displayed as an overlay which makes it impossible to use inline with the rest of the application. Additionally, there are several bugs and missing features. For example, it is impossible to know when the value of the picker column has changed using public APIs. This is valuable for updating other columns in response to that data. ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - Introduces `ion-picker` as an inline wheel picker component. The overlay picker is still available using `ion-picker-legacy`. - The implementation of this component resolves linked bugs. It also resolves linked features by exposing an `ionChange` event for developers to listen for. ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change, please describe the impact and migration path for existing applications below. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> Dev-build: `7.5.8-dev.11702398696.1ab62ea9` --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Shawn Taylor <[email protected]> Co-authored-by: Maria Hutt <[email protected]> Co-authored-by: Amanda Johnston <[email protected]> Co-authored-by: Sean Perkins <[email protected]> Co-authored-by: Brandy Carney <[email protected]>
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. |
Prerequisites
Ionic Framework Version
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
*Note, you may need to adjust the CSS for .picker-opt-disabled in order to see the disabled options more easily.
Code Reproduction URL
https://github.com/austinrzg/angular-fqvgd8
Ionic Info
Ionic:
Ionic CLI : 5.4.16
Utility:
cordova-res : not installed
native-run : not installed
System:
NodeJS : v16.18.1
npm : 8.1.2
OS : Windows 10
Additional Information
No response
The text was updated successfully, but these errors were encountered: