Skip to content
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

Impossible to change the opacity of an ion-select placeholder #17446

Closed
StriderRanger opened this issue Feb 8, 2019 · 21 comments
Closed

Impossible to change the opacity of an ion-select placeholder #17446

StriderRanger opened this issue Feb 8, 2019 · 21 comments
Labels
package: core @ionic/core package type: feature request a new feature, enhancement, or improvement

Comments

@StriderRanger
Copy link

Bug Report

Ionic version:

[x] 4.x

Current behavior:

There is no CSS property that makes it possible to change the opacity of the placeholder of an ion-select

Expected behavior:

In the ion-input, there is the --placeholder-opacity property that controls the opacity of an ion-input. It would be helpful to have the same property in the ion-select component.

Steps to reproduce:

Related code:

Other information:

Ionic info:

   ionic (Ionic CLI)             : 4.7.1 
   Ionic Framework               : @ionic/angular 4.0.0
   @angular-devkit/build-angular : 0.11.4
   @angular-devkit/schematics    : 7.2.3
   @angular/cli                  : 7.2.3
   @ionic/angular-toolkit        : 1.2.2
@ionitron-bot ionitron-bot bot added the triage label Feb 8, 2019
@Sarfarazsajjad
Copy link

try this

ion-select {
    opacity: 1 !important;
}

@StriderRanger
Copy link
Author

StriderRanger commented Feb 9, 2019

try this

ion-select {
    opacity: 1 !important;
}

Thanks for the reply, but unfortunately It didn't work.
I think that applying the opacity on the ion-select changes the opacity of the whole component and not of the placeholder.

@StriderRanger StriderRanger changed the title Impossible to change to opacity of an ion-select placeholder Impossible to change the opacity of an ion-select placeholder Feb 19, 2019
@bmlyon
Copy link

bmlyon commented Mar 18, 2019

I also have this problem.

In Chrome I can see the shadow styles as an inline style tag that says .select-placeholder{opacity: .33};

@FazioNico
Copy link

same problem. Any solution to solve ?

@bmlyon
Copy link

bmlyon commented Mar 28, 2019

I ended up using css pseudo content instead of placeholders as a temporary workaround. select:before{content:"whatever the placeholder would have been"}

@brandyscarney brandyscarney added package: core @ionic/core package type: feature request a new feature, enhancement, or improvement labels Apr 11, 2019
@ghost
Copy link

ghost commented Apr 12, 2019

i have the same problem

@codepiter
Copy link

an unorthodox method but it was useful for me to change a js file after compiling:
\ node_modules \ @Ionic \ core \ dist \ esm \ es5 \ build \ j241fzpw.entry.js

select-placeholder {color: currentColor; opacity: 0.33}

for

select-placeholder {color: currentColor; opacity: 1}

I'm not sure but maybe the file in question could vary.

Salu2.

@pbeltrand
Copy link

pbeltrand commented May 8, 2019

workaround:
I put a label that hides when a value is selected..

<ion-label slot="start" *ngIf="servicio == null">Seleccione el Servicio</ion-label>
<ion-select okText="Seleccionar"  [(ngModel)]="servicio" placeholder="">
     <ion-select-option *ngFor="let item of servicios | async" value="{{ item.id }}">{{ item.nombre }}</ion-select-option>
</ion-select>

@nla-asia
Copy link

this issue is still happening

@liquidcms
Copy link

I have this issue as well. ion-select placeholder opacity is .33 whereas all other placeholders are .5. Why is this so difficult to fix?

@invot
Copy link

invot commented Jun 26, 2019

Same issue. Kinda a make-or-break problem. These components don't seem very customizable in general. Applying any kind of custom styling feels like rocket science.

@liquidcms
Copy link

liquidcms commented Jun 26, 2019

I ended up using @pbeltrand's hack, which doesn't use placeholder (since it is styled wrong and not modifyable). Uses label instead and hides when a selection is made:

      <ion-item class="input-item">
        <ion-label style="--opacity:.5" slot="start" *ngIf="yearLabel == null">School Year</ion-label>
        <ion-select style="--padding-start: 0px" [(ngModel)]="yearLabel" placeholder="" formControlName="year" >
          <ion-select-option value="FK-AK1">FK-AK1</ion-select-option>
          <ion-select-option value="AK2-AK3">AK2-AK3</ion-select-option>
          <ion-select-option value="AK4-AK5">AK4-AK5</ion-select-option>
          <ion-select-option value="AK6-AK7">AK6-AK7</ion-select-option>
          <ion-select-option value="AK8-GY1">AK8-GY1</ion-select-option>
          <ion-select-option value="Förälder">Förälder</ion-select-option>
        </ion-select>
      </ion-item>

now i am on to my next hack to try to figure out how make ion-menu-button slightly larger; because it is also not changeable...

perhaps we need to wait until Ionic 5 for the team to realize how silly it is to try to guess at how everyone wants their app to look.. :(

@nporchis
Copy link

nporchis commented Jul 25, 2019

i got the same issue :(.
on my side i took the issue in the other side setting the oppacity of placeholder inputs to .33:

.sc-ion-input-md-h {
--placeholder-opacity: 0.33;
}

@liamdebeasi
Copy link
Member

Thanks for the issue. This has been resolved via #19893 and will be available in an upcoming release of Ionic Framework.

@pjc0247
Copy link

pjc0247 commented Dec 5, 2019

@liamdebeasi Hi, Is there any way to test the change now? I tried 4.11.5-dev and 4.12.0 but both not worked.

@liamdebeasi
Copy link
Member

@pjc0247 This feature will be released in the next major version of Ionic Framework (v5.0). We are rolling out betas, and this feature was released as part of beta 1.

See the changelog for more info: https://github.com/ionic-team/ionic/blob/master/CHANGELOG.md

There are also instructions here for how to upgrade to v5 if you would like to start testing the betas: https://github.com/ionic-team/ionic/blob/master/CHANGELOG.md#500-beta0-2019-10-15

@pjc0247
Copy link

pjc0247 commented Dec 5, 2019

@liamdebeasi So, this will not be applied to v4?

@liamdebeasi
Copy link
Member

Correct, this feature will not be in v4.

@pjc0247
Copy link

pjc0247 commented Dec 5, 2019

i think NObody wants to migrate the entire project for a single CSS property. You may think this is a feature update, but actual users think this is a bug.

@liamdebeasi
Copy link
Member

For the purposes of writing changelogs and following semantic versioning, we consider anything that makes additions to the API to be a feature. In this case, a CSS Variable was added to the API.

Most developers will be able to upgrade to v5 with minimal changes to their application. The upgrade path from v4 to v5 is much simpler and faster than the upgrade path from v3 to v4. In some cases, developers may not have to change anything in their application depending on the complexity and scope of their app.

For more information about some of the breaking changes in v5, please see the changelog for the v5 betas:

Breaking changes in beta 1: https://github.com/ionic-team/ionic/blob/master/CHANGELOG.md#breaking-changes
Breaking changes in beta 0: https://github.com/ionic-team/ionic/blob/master/CHANGELOG.md#breaking-changes-1

@ionitron-bot
Copy link

ionitron-bot bot commented Jan 4, 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.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Jan 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: core @ionic/core package type: feature request a new feature, enhancement, or improvement
Projects
None yet
Development

No branches or pull requests