Skip to content

Commit 2cc44b5

Browse files
authored
Merge pull request #423 from vallemar/fix-text-field-color-placeholder
[text-field](ios): fix default color placeholder and types
2 parents 9b2fd6c + 837fddb commit 2cc44b5

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/textfield/textfield.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55

66
import { Color, TextField as NTextField } from '@nativescript/core';
7+
import { VerticalTextAlignment } from '@nativescript-community/text';
78

89
type PropType<TObj, TProp extends keyof TObj> = TObj[TProp];
910

@@ -24,7 +25,14 @@ export class TextField extends NTextField {
2425
placeholderColor: Color;
2526
variant: string;
2627
error: string;
28+
strokeColor: Color;
29+
strokeInactiveColor: Color;
30+
strokeDisabledColor: Color;
31+
floatingColor: Color;
32+
floatingInactiveColor: Color;
33+
buttonColor: Color;
2734
digits: string;
35+
verticalTextAlignment: VerticalTextAlignment;
2836

2937
focus();
3038
blur();

src/textfield/textfield.ios.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,8 @@ export class TextField extends TextFieldBase {
305305
this._updateAttributedPlaceholder();
306306
}
307307
[placeholderColorProperty.setNative](value: UIColor | Color) {
308+
const color = value instanceof Color ? value.ios : value;
309+
this.nativeViewProtected.setNormalLabelColorForState(color, MDCTextControlState.Normal);
308310
this._updateAttributedPlaceholder();
309311
}
310312
[hintProperty.setNative](value: string) {

0 commit comments

Comments
 (0)