Skip to content

Commit 54b7e76

Browse files
author
farfromrefug
committed
Merge remote-tracking branch 'origin/master'
2 parents 0dc755e + 728709d commit 54b7e76

File tree

8 files changed

+36
-12
lines changed

8 files changed

+36
-12
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [1.3.40](https://github.com/nativescript-community/ui-label/compare/v1.3.39...v1.3.40) (2025-09-29)
7+
8+
### Bug Fixes
9+
10+
* **ios:** another edge case for text as NSAttributedString ([691d460](https://github.com/nativescript-community/ui-label/commit/691d4607b4aca7a4ad83064976d974ed301f8cdc))
11+
12+
## [1.3.39](https://github.com/nativescript-community/ui-label/compare/v1.3.38...v1.3.39) (2025-09-29)
13+
14+
### Bug Fixes
15+
16+
* **ios:** autoFontSize working with NSAttributedString in text property ([2aadecf](https://github.com/nativescript-community/ui-label/commit/2aadecffedc2efd4bad14e8ad282250c69bd9c63))
17+
618
## [1.3.38](https://github.com/nativescript-community/ui-label/compare/v1.3.34...v1.3.38) (2025-09-26)
719

820
### Bug Fixes

demo-vue

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "1.3.38",
2+
"version": "1.3.40",
33
"$schema": "node_modules/@lerna-lite/cli/schemas/lerna-schema.json",
44
"packages": [
55
"packages/*"

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@
4949
"homepage": "https://github.com/nativescript-community/ui-label",
5050
"readmeFilename": "README.md",
5151
"dependencies": {
52-
"@nativescript-community/plugin-seed-tools": "file:tools"
52+
"@nativescript-community/plugin-seed-tools": "portal:tools"
5353
},
5454
"devDependencies": {
55-
"@nativescript-community/text": "^1.6.8"
55+
"@nativescript-community/text": "^1.6.15"
5656
},
5757
"bootstrapper": "nativescript-plugin-seed",
5858
"commitlint": {

packages/label/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [1.3.40](https://github.com/nativescript-community/ui-label/compare/v1.3.39...v1.3.40) (2025-09-29)
7+
8+
**Note:** Version bump only for package @nativescript-community/ui-label
9+
10+
## [1.3.39](https://github.com/nativescript-community/ui-label/compare/v1.3.38...v1.3.39) (2025-09-29)
11+
12+
**Note:** Version bump only for package @nativescript-community/ui-label
13+
614
## [1.3.38](https://github.com/nativescript-community/ui-label/compare/v1.3.34...v1.3.38) (2025-09-26)
715

816
**Note:** Version bump only for package @nativescript-community/ui-label

packages/label/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nativescript-community/ui-label",
3-
"version": "1.3.38",
3+
"version": "1.3.40",
44
"description": "Alternative to the built-in NativeScript Label but with better performance and additional features such as HTML rendering and more.",
55
"main": "./index",
66
"sideEffects": false,
@@ -42,7 +42,7 @@
4242
"license": "Apache-2.0",
4343
"readmeFilename": "README.md",
4444
"dependencies": {
45-
"@nativescript-community/text": "^1.6.8"
45+
"@nativescript-community/text": "^1.6.15"
4646
},
4747
"gitHead": "a08eb50756c9a5d16fc8aa6ff7fba0051c71d1e0"
4848
}

src/label/index.ios.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,10 @@ export class Label extends LabelBase {
252252
return result.height;
253253
}
254254

255+
useNSAttributedString() {
256+
return this.formattedText || this.html || (this.text instanceof NSAttributedString)
257+
}
258+
255259
updateVerticalAlignment(applyVerticalTextAlignment = true) {
256260
const nativeView = this.nativeTextViewProtected;
257261
if (!this.mCanUpdateVerticalAlignment) {
@@ -407,7 +411,7 @@ export class Label extends LabelBase {
407411
// if (this.isUsingNSTextView) {
408412
// desiredSize.height += nativeView.textContainerInset.top + nativeView.textContainerInset.bottom;
409413
// }
410-
if (resetFont && !this.formattedText && !this.html) {
414+
if (resetFont && this.useNSAttributedString()) {
411415
nativeView.font = resetFont;
412416
}
413417

@@ -653,7 +657,7 @@ export class Label extends LabelBase {
653657
const nativeView = this.nativeTextViewProtected;
654658
const newFont: UIFont = value instanceof Font ? value.getUIFont(nativeView.font) : value;
655659
nativeView.font = newFont;
656-
if (this.formattedText || this.html) {
660+
if (this.useNSAttributedString()) {
657661
this._setNativeText();
658662
}
659663
}
@@ -877,9 +881,9 @@ export class Label extends LabelBase {
877881
let expectSize;
878882

879883
const stepSize = this.autoFontSizeStep || 2;
880-
884+
const changeFont = !this.useNSAttributedString();
881885
const updateFontSize = (font) => {
882-
if (this.formattedText || this.html) {
886+
if (!changeFont) {
883887
NSLabelUtils.updateFontRatioRatio(textView, font.pointSize / fontSize);
884888
} else {
885889
textView.font = font;
@@ -905,7 +909,7 @@ export class Label extends LabelBase {
905909
expectFont = newFont;
906910
} else {
907911
expectFont = newFont;
908-
if (!this.formattedText && !this.html) {
912+
if (changeFont) {
909913
textView.font = newFont;
910914
}
911915
break;

0 commit comments

Comments
 (0)