-
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/feat: ion-select with more than 5 items lacks visual indicator on Material Theme #23760
Comments
This issue has been labeled as If you'd like to work on this issue, please comment here letting us know that you would like to submit a pull request for it. This helps us to keep track of the pull request and make sure there isn't duplicated effort. For a guide on how to create a pull request and test this project locally to see your changes, see our contributing documentation. Thank you! |
Hey @cmaas, thanks for this issue! I agree that this is a UX problem that should be fixed. If you or another community member would like to work on this, I would also suggest referring to the Material Design spec to see if our sizes for the dialog and list items match their guidelines: https://www.material.io/components/dialogs#specs |
@willmartindev Sure, I'm happy to help. I looked up the specs. Ionic's list item height is correct (48px). The specs expect 48dp (https://www.material.io/components/lists#specs). So it makes no sense to reduce the height of an item. Ionic has a somewhat arbitrary max-height of 240px for dialogs. See
The specs for the height of dialogs is defined as:
Source: https://material.io/components/dialogs#behavior → Section Scaling and adaptation Examples throughout the specs usually show a cropped list item if the content is scrollable. See here:
But the specs don't explicitly mention a height that shows only half of an element. Easy solution: Set More complex solution: Discuss if you want to update dialogs/alerts to the above Material spec: A minimum top and bottom padding of 48px and a max-height of up to 560px. This probably requires a lot more testing etc., because it depends whether the alert of an I think a good approach would be to implement a more sensitive max-height of 264px first and gradually adjust the height of a dialog in other versions. Imho, the goal is to give users a visual indicator that the list is scrollable. Whether or not the screen could be filled a bit better is a different matter. |
Hi @cmaas, thank you very much for the report and deep dive. I've resolved this via #23976 and the fix will be available in a future release of Ionic. I decided to go with your suggestion to just increase the list height for now, and I also made a separate issue for the mismatch with the MD spec: #23977 |
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. |
Prequisites
Ionic Framework Version
Current Behavior
An
ion-select
with more than 5 items has no visual indicator that the selection area is scrollable, but only for the Material Theme. The iOS theme shows half of the 6th item, which serves as a visual indicator that the whole area is scrollable.The reason for this is simple:
240px / 44px = 5,45 items to show.
240px / 48px = exactly 5 items.
Solution:
Because 264px / 48px = 5.5 items.
Sure, I can override this in
app.css
, but I think it makes sense as a good default for all ionic apps, since it is confusing for users.Expected Behavior
Show 5.5 items in Material Theme
Steps to Reproduce
Or see here and toggle between themes: https://ionicframework.com/docs/api/select
Code Reproduction URL
https://ionicframework.com/docs/api/select
Ionic Info
Package.json:
"@ionic/core": "5.6.12"
Additional Information
The text was updated successfully, but these errors were encountered: