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: ion-select without ion-label does not render properly

See original GitHub issue

Bug Report

Ionic version:

[x] 4.x

Current behavior: When setting an ion-select without an ion-label, the select does not take the whole space and therefore looks very odd.

Expected behavior: The ion-select should just take any available space, just like ion-input does. It is somewhat fixable by setting in css:

ion-select {
  max-width: 100%;
}

but it should by default just expand

Related code:

<ion-item>
  <ion-icon slot="start" name="car"></ion-icon>
  <ion-select>
    <ion-select-option value="1">Option 1</ion-select-option>
  </ion-select>
</ion-item>

Other information:

Ionic info:

Ionic:

   Ionic CLI                     : 5.2.2 (/.nvm/versions/node/v10.1.0/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.6.1
   @angular-devkit/build-angular : 0.13.9
   @angular-devkit/schematics    : 7.3.9
   @angular/cli                  : 7.3.9
   @ionic/angular-toolkit        : 1.5.1

Cordova:

   Cordova CLI       : 6.5.0
   Cordova Platforms : ios 4.3.1
   Cordova Plugins   : cordova-plugin-ionic 5.3.1, cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.1, (and 7 other plugins)

Utility:

   cordova-res : 0.3.0 (update available: 0.6.0)
   native-run  : 0.2.5 (update available: 0.2.7)

System:

   Android SDK Tools : 26.1.1 (/usr/local/Cellar/android-sdk/24.4.1_1)
   ios-deploy        : 1.9.2
   ios-sim           : 6.1.2
   NodeJS            : v10.1.0 (/.nvm/versions/node/v10.1.0/bin/node)
   npm               : 6.10.0
   OS                : macOS Mojave
   Xcode             : Xcode 10.2.1 Build version 10E1001

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
brandyscarneycommented, Dec 16, 2019

There is a workaround to this, by setting the following (remove the padding if you don’t want it aligned left with the input):

ion-select {
  min-width: 100%;
  padding-left: 0;
}

Here’s a Codepen: https://codepen.io/brandyscarney/pen/NWPbdyr

Unfortunately issues with workarounds are not at the top of our priority list at the moment but we always appreciate any help to push issues to the top with PRs. I’ll add the help wanted label to this which will adds steps on how to contribute. 🙂

The problem is the select & datetime are designed to be with a label so it will take some work to make sure they look good in instances with & without a label and where there are multiple of them in one item (see “Date”):

0reactions
ionitron-bot[bot]commented, Nov 6, 2020

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

ionic select won't render properly with dynamic values? Ionic 4
I am facing a problem while using ionic 4, and ionic-select. The problem comes when i have some data and i am binding...
Read more >
[Ionic 5] [Angular] ion-select does not show the selected values
I tried to this approach and unfortunately it did not work. Actually it stopped showing the values after clicking as well. <ion-item> <ion-label...
Read more >
Announcing Ionic 6 - Ionic Blog
We have also added error and helper text slots in addition to a character counter. Additionally, ion-select has been updated to use the ......
Read more >
Html Select "Done" Label Not Showing On Ionic For Ios
[Ionic 5] [Angular] ion-select does not show the selected values It works properly ... questionsbug: ion-select without ion-label does not render properly.
Read more >
Date picker popup in Ionic 6 | Damir's Corner
<ion-item> <ion-label>Pick date</ion-label> <ion-datetime ... It no longer has any meaning as the picker is now rendered inline and the date ...
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