question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug/feat: ion-select with more than 5 items lacks visual indicator on Material Theme

See original GitHub issue

Prequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x

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:

.alert-radio-group.sc-ion-alert-ios, .alert-checkbox-group.sc-ion-alert-ios {
  max-height: 240px;
}
.alert-tappable.sc-ion-alert-ios {
    height: 44px;
}

240px / 44px = 5,45 items to show.

.alert-radio-group.sc-ion-alert-md, .alert-checkbox-group.sc-ion-alert-md {
    max-height: 240px;
}

.alert-tappable.sc-ion-alert-md {
    height: 48px;
}

240px / 48px = exactly 5 items.

Solution:

.alert-radio-group.sc-ion-alert-md, .alert-checkbox-group.sc-ion-alert-md {
    max-height: 264px;
}

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

<ion-item>
          <ion-label>Music</ion-label>
          <ion-select value="03">
            <ion-select-option value="01">Alice in Chains</ion-select-option>
            <ion-select-option value="02">Green Day</ion-select-option>
            <ion-select-option value="03">Nirvana</ion-select-option>
            <ion-select-option value="04">Pearl Jam</ion-select-option>
            <ion-select-option value="05">Smashing Pumpkins</ion-select-option>
            <ion-select-option value="06">Soundgarden</ion-select-option>
            <ion-select-option value="07">Stone Temple Pilots</ion-select-option>
          </ion-select>
 </ion-item>

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

list-ios list-md

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
amandaejohnstoncommented, Sep 24, 2021

Hi @cmaas, thank you very much for the report and deep dive. I’ve resolved this via https://github.com/ionic-team/ionic-framework/pull/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: https://github.com/ionic-team/ionic-framework/issues/23977

0reactions
ionitron-bot[bot]commented, Oct 27, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ion-select: Select One or Multiple Value Boxes or Placeholders
ion-select is represented by selected value(s), or a placeholder, and dropdown icon. When you tap select, a dialog box appears with an easy...
Read more >
Ionic Archives - Ionic Blog - Ionic.io
Toggles can now display explicit on/off labels to provide a better visual indication of state. This feature can be enabled using the new...
Read more >
Mobile App Development with Ionic, Revised Edition
apps run faster and can handle more complexity than Ionic 1 apps. ... With the framework leveraging Cordova and its plug-in library, the...
Read more >
Instruction Project of.four subject areas in each of four grade ...
The objectives and items were written by over 300 elementary and secondary teachers; representing forty Chicago suburban school districts, who participated.
Read more >
Infrastructures for information work: multimedia technologies
It presents an overview of the most recent developments in relevant technologies together ... The theme of Chapter 17 is tele- communication technologies....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found