Change color for floating label when textbox is disabled

Hi guys,

I want to change the color of the floating label for a textbox/numeric textbox if the textbox/numeric textbox is disabled.

These are the disabled textboxes:


And I want the label to have the color like this, from gray to black (only the floating label, without the border):


It is possible for a disabled input to have a custom color for the floating label?

Thank you


4 Replies 1 reply marked as answer

SP Sureshkumar P Syncfusion Team April 27, 2022 12:21 PM UTC

We will validate the requirement in our component. We update you in two business days (April 29th, 2022).



SP Sureshkumar P Syncfusion Team April 29, 2022 09:42 AM UTC

You can achieve your requirement by applying the below styles in your application.


Please find the CSS code example here:

.e-outline.e-float-input.e-control-wrapper.e-input-group.e-disabled

  .e-float-text,

.e-outline.e-float-input.e-control-wrapper.e-input-group.e-disabled

  .e-float-text.e-label-top,

.e-outline.e-float-input.e-control-wrapper.e-disabled

  input[disabled]

  ~ label.e-float-text,

.e-outline.e-float-input.e-control-wrapper.e-disabled

  input[disabled]

  ~ label.e-label-top.e-float-text,

.e-outline.e-float-input.e-control-wrapper input[disabled] ~ label.e-float-text,

.e-outline.e-float-input.e-control-wrapper

  input[disabled]

  ~ label.e-label-top.e-float-text,

.e-outline.e-float-input.e-control-wrapper.e-disabled label.e-float-text,

.e-outline.e-float-input.e-control-wrapper.e-disabled

  label.e-float-text.e-label-top,

.e-outline.e-float-input.e-control-wrapper:not(.e-error)

  input[disabled]

  ~ label.e-float-text,

.e-outline.e-float-input.e-control-wrapper:not(.e-error)

  input[disabled]

  ~ label.e-label-top.e-float-text,

.e-outline.e-float-input.e-control-wrapper.e-disabled:not(.e-error)

  input[disabled]

  ~ label.e-float-text,

.e-outline.e-float-input.e-control-wrapper.e-disabled:not(.e-error)

  input[disabled]

  ~ label.e-label-top.e-float-text,

.e-outline.e-float-input.e-control-wrapper.e-disabled.e-bigger:not(.e-error)

  input[disabled]

  ~ label.e-float-text {

  colorblack;

  -webkit-text-fill-colorblack;

}

 

 


Find the sample here: https://stackblitz.com/edit/angular-j4rttz-lkgavc?file=app.component.css


Marked as answer

CI Ciprian-Catalin April 29, 2022 12:18 PM UTC

It worked, thank you again!



SP Sureshkumar P Syncfusion Team May 2, 2022 05:50 AM UTC

Ciprian,


Thanks for your update.


Regards,

Sureshkumar P


Loader.
Up arrow icon