ui-material-components icon indicating copy to clipboard operation
ui-material-components copied to clipboard

TextField Outline Android: CSS stroke-inactive-color and floating-inactive-color not correctly applied

Open felixkrautschuk opened this issue 4 years ago • 6 comments

If the demo apps cannot help and there is no issue for your problem, tell us about it

Please, ensure your title is less than 63 characters long and starts with a capital letter.

This is my css:

.md-textfield-outline {
    floating-color: blue;
    floating-inactive-color: lightblue;
    stroke-color: green;
    stroke-inactive-color: lightgreen;
    placeholder-color: #757575;
}

Inactive: Bildschirmfoto 2020-12-14 um 12 00 56

Active: Bildschirmfoto 2020-12-14 um 12 02 10

The floating-inactive-color should be lightblue, but it actually has the value of placeholder-color. The stroke-inactive-color should be lightgreen but is actually has the value of stroke-color.

So the properties stroke-inactive-color and floating-inactive-color have no effect on Android.

Which platform(s) does your issue occur on?

  • Android
  • tested on Android 10 and 5.1
  • emulator and device

Please, provide the following version numbers that your issue occurs with:

  • CLI: 7.0.11
  • Cross-platform modules: 7.0.13
  • Runtime(s): 7.0.1
  • Plugin(s): @nativescript-community/ui-material-textfield": "5.1.15"

Please, tell us how to recreate the issue in as much detail as possible.

Describe the steps to reproduce it.

Is there any code involved?

See the css code snippet in description.

felixkrautschuk avatar Dec 14 '20 11:12 felixkrautschuk

@farfromrefug thank you for the very fast fix!

The inactive color for stroke and floating are working now as expected on Android. Now there is a new "problem" on Android:

Bildschirmfoto 2020-12-14 um 16 54 47

The hint (placeholder) has now the color of floating-inactive-color. So now the placeholder-color has no effect on Android (it is working as expected on iOS)

It is not such a big deal, I just noticed that by accident.

felixkrautschuk avatar Dec 14 '20 16:12 felixkrautschuk

@felixkrautschuk actually i did it on purpose. there is some confusion on the android api. I am not sure what i need to do to get you to be able to set a placeholder (non focused and no text). before my change it was the same thing as setting floating color. Not sure what to do :s

farfromrefug avatar Dec 14 '20 16:12 farfromrefug

@farfromrefug I'm pretty sure the placeholder-color was working as expected before the latest fix. But I prefer the latest version ;) I will leave this issue open open for now, maybe I can get some time to have a deeper look into this.

Thanks for you fast reply and your investigations

felixkrautschuk avatar Dec 14 '20 16:12 felixkrautschuk

@felixkrautschuk it did but then floating-inactive-color was not working. You can get the same behavior by replacing placeholder-color with floating-inactive-color

farfromrefug avatar Dec 14 '20 16:12 farfromrefug

@farfromrefug can you add a feature to set cursor color as well or at least leave it black, for now in android it is gray which makes it hard to understand where is your cursor. It would be much of help if you go thru this issue, in IOS cursor color is the same as stroke-color, however, in android it is gray

NavruzbekNoraliev avatar Feb 09 '21 12:02 NavruzbekNoraliev

@NavruzbekNoraliev good idea. Dont have time to work on this though. PR are welcome

farfromrefug avatar Feb 09 '21 13:02 farfromrefug