-> Yes
-> I wasn't able to change the color of some textfields hints and I figured out they all had dynamic hints because of internationalisation.
textfields with static hints don't have this issue.
At least on IOS, had not had the chance to test on Android
Simply by creating a textfield with dynamic hints, sample provided:
<TextField col="1" [(ngModel)]="loginData.fname" hint="{{lang._('fname')}}" style="color:#04ccf0; placeholder-color:rgba(255,255,255,.6); text-align:center; padding:10;"></TextField>
lang._() returns a simple string and is used all over the code for translation.
@vincentduprez I have tested your case and everything seems to work as expected. However, the color used for placeholder-color along with the alpha transparency is making it almost impossible to distinguish. Use more contrast color and you will see the changes being applied to your TextField.
e.g.
<TextField hint="SOME HINT" style="color:#04ccf0; background-color:lightgray; placeholder-color:rgba(255,122,255,0.6);"></TextField>
Test application used can be found here
Hi @NickIliev thanks for testing out,
unfortunately it's not, I'm working on a dark background and the default greyish color of the placeholder makes it impossible to read, the half transparent white color makes it a light grey easy to read on the other items.
I'll have a look a what element can cause this to happen.
@vincentduprez any updates on the issue? I am struggling to understand the problem as the placeholder color seems to be applied with no hassle - let me know if you have some additional information that can help me reproduce the problem.
@vincentduprez closing this issue as it is not reproducible on our side but please if you have additional information that can help us let me know and I will retest and reopen the issue.
Something similar is happening to me, only when using iOS (Android is fine): I'm using nativescript-localize for translations, and using some language keys for the TextField's hints.
When I get into the login screen I get something like this (if you squint your eyes you will see the placeholder text is there):
I should add that if I login, and then logout, I get this :
Placeholders magically appear.
The actual code for the TextFields is like this:
<TextField
autocapitalizationType="none"
autocorrect="false"
class="form-input"
hint="{{ 'public-form:username:placeholder' | L }}"
keyboardType="email"
returnKeyType="next"
></TextField>
The CSS class is this one:
.form-input {
background-color: transparent;
background-position: 0% 50%;
background-repeat: no-repeat;
border-bottom-color: #fff;
border-bottom-width: 1;
color: #ffffff;
padding-left: 45;
padding-right: 10;
placeholder-color: #ffffff;
}
Yes, I still have this issue as well, and behaves the same way as yours.
I really think this issue should be reopened.
Don't have much time to narrow it down. but if I have I will try to create a repo to reproduce the issue.
I had the same issue and after two-way binding the textfield with an ngModel it started to apply the placeholder-color to the textfield (this for iOS).
Should we report this again?
I'm not sure how they handle these issues.
@vincentduprez @hugoangelo @gabitoesmiapodo
I see that you all have the same issue reoccurring - I will retest with the additional information and log this as a bug after confirming the bug - stay tuned for updates.
@vincentduprez @hugoangelo @gabitoesmiapodo
Update: I can now confirm that indeed dynamically changing the hint value is resetting the placeholder-color on iOS. I have opened a new issue and logged this as a bug. You can find the issue here - I will update the info once we have stable solution or workaround.
tried style.placeholderColor="red" ?
@creativeJoe Yes,
Setting style.placeholderColor="color"
works in code-behind and xml
. But I think the desirable approach would be from css
or bindingContext
.
{N} 3.4.1
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
@vincentduprez @hugoangelo @gabitoesmiapodo
I see that you all have the same issue reoccurring - I will retest with the additional information and log this as a bug after confirming the bug - stay tuned for updates.