From eb4c61fc413c9a2ee6a9ef6aef10a234644516df Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Tue, 9 Jun 2020 22:44:16 -0700 Subject: [PATCH] fix(text-base): letter spacing for textfield (#8627) closes https://github.com/NativeScript/NativeScript/pull/8626 closes https://github.com/NativeScript/NativeScript/issues/4892 --- e2e/ui-tests-app/app/fonts-tests/text-field-page.xml | 2 ++ e2e/ui-tests-app/package.json | 1 + nativescript-core/ui/text-base/text-base.ios.ts | 3 +++ 3 files changed, 6 insertions(+) diff --git a/e2e/ui-tests-app/app/fonts-tests/text-field-page.xml b/e2e/ui-tests-app/app/fonts-tests/text-field-page.xml index 7072cdcbc..b68b429fd 100644 --- a/e2e/ui-tests-app/app/fonts-tests/text-field-page.xml +++ b/e2e/ui-tests-app/app/fonts-tests/text-field-page.xml @@ -6,6 +6,8 @@ + + diff --git a/e2e/ui-tests-app/package.json b/e2e/ui-tests-app/package.json index c12826251..caf6f5d4e 100644 --- a/e2e/ui-tests-app/package.json +++ b/e2e/ui-tests-app/package.json @@ -35,6 +35,7 @@ "gitHead": "8ab7726d1ee9991706069c1359c552e67ee0d1a4", "readme": "NativeScript Application", "scripts": { + "clean": "npx rimraf hooks node_modules platforms package-lock.json", "e2e": "tsc -p e2e && mocha --opts ../config/mocha.opts --recursive e2e --appiumCapsLocation ../config/appium.capabilities.json", "e2e-debug": "./node_modules/.bin/ns-dev-appium --startSession", "e2e-watch": "tsc -p e2e --watch", diff --git a/nativescript-core/ui/text-base/text-base.ios.ts b/nativescript-core/ui/text-base/text-base.ios.ts index 1d83d1f59..1ebf4766c 100644 --- a/nativescript-core/ui/text-base/text-base.ios.ts +++ b/nativescript-core/ui/text-base/text-base.ios.ts @@ -288,6 +288,9 @@ export class TextBase extends TextBaseCommon { if (style.letterSpacing !== 0 && this.nativeTextViewProtected.font) { const kern = style.letterSpacing * this.nativeTextViewProtected.font.pointSize; dict.set(NSKernAttributeName, kern); + if (this.nativeTextViewProtected instanceof UITextField) { + this.nativeTextViewProtected.defaultTextAttributes.setValueForKey(kern, NSKernAttributeName); + } } if (style.color) {