@nativescript-community/ui-label 1.2.5 → 1.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.2.6](https://github.com/nativescript-community/ui-label/compare/v1.2.5...v1.2.6) (2022-02-09)
7
+
8
+ **Note:** Version bump only for package @nativescript-community/ui-label
9
+
10
+
11
+
12
+
13
+
6
14
  ## [1.2.5](https://github.com/nativescript-community/ui-label/compare/v1.2.4...v1.2.5) (2022-02-09)
7
15
 
8
16
  **Note:** Version bump only for package @nativescript-community/ui-label
package/label.ios.js CHANGED
@@ -307,7 +307,7 @@ export class Label extends LabelBase {
307
307
  fontSize,
308
308
  familyName,
309
309
  fontWeight,
310
- color: this.color,
310
+ // color: this.color,
311
311
  letterSpacing: this.letterSpacing,
312
312
  lineHeight: this.lineHeight,
313
313
  textAlignment: this.nativeTextViewProtected.textAlignment
@@ -346,7 +346,12 @@ export class Label extends LabelBase {
346
346
  }
347
347
  else {
348
348
  if (this.formattedText || this.html) {
349
- this._setNativeText();
349
+ if (this.html) {
350
+ this.updateHTMLString();
351
+ }
352
+ else {
353
+ super._setNativeText();
354
+ }
350
355
  }
351
356
  else {
352
357
  this.nativeTextViewProtected.textColor = color;
@@ -454,6 +459,10 @@ export class Label extends LabelBase {
454
459
  else {
455
460
  super._setNativeText();
456
461
  }
462
+ if (this.color) {
463
+ const color = this.color instanceof Color ? this.color.ios : this.color;
464
+ this._setColor(color);
465
+ }
457
466
  this.updateTextContainerInset();
458
467
  this._requestLayoutOnTextChanged();
459
468
  }
@@ -657,7 +666,11 @@ export class Label extends LabelBase {
657
666
  return currentFont;
658
667
  }
659
668
  const autoSizeKey = fixedWidth + '_' + fixedHeight;
660
- if (!force && autoSizeKey === this._lastAutoSizeKey) {
669
+ const fontSize = this.style.fontSize || 17;
670
+ let expectFont = (this.style.fontInternal || Font.default).getUIFont(UIFont.systemFontOfSize(fontSize));
671
+ //if we are not on the "default" font size we need to measure again or we could break
672
+ //the layout behavior like for flexbox where there are multiple measure passes
673
+ if (!force && autoSizeKey === this._lastAutoSizeKey && expectFont.pointSize === textView.font.pointSize) {
661
674
  return null;
662
675
  }
663
676
  currentFont = textView.font;
@@ -665,9 +678,6 @@ export class Label extends LabelBase {
665
678
  const nbLines = textView.textContainer.maximumNumberOfLines;
666
679
  // we need to reset verticalTextAlignment or computation will be wrong
667
680
  this.updateTextContainerInset(false);
668
- const fontSize = this.style.fontSize || 17;
669
- let expectFont = (this.style.fontInternal || Font.default).getUIFont(UIFont.systemFontOfSize(fontSize));
670
- //first reset the font size
671
681
  let expectSize;
672
682
  const stepSize = this.autoFontSizeStep || 1;
673
683
  const updateFontSize = (font) => {
@@ -678,6 +688,7 @@ export class Label extends LabelBase {
678
688
  textView.font = font;
679
689
  }
680
690
  };
691
+ //first reset the font size
681
692
  updateFontSize(expectFont);
682
693
  const size = () => {
683
694
  if (nbLines === 1) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nativescript-community/ui-label",
3
- "version": "1.2.5",
3
+ "version": "1.2.6",
4
4
  "description": "Alternative to the built-in NativeScript Label but with better performance and additional features such as HTML rendering and more.",
5
5
  "main": "./label",
6
6
  "sideEffects": false,
@@ -32,7 +32,7 @@
32
32
  "license": "Apache-2.0",
33
33
  "readmeFilename": "README.md",
34
34
  "dependencies": {
35
- "@nativescript-community/text": "^1.4.32"
35
+ "@nativescript-community/text": "^1.4.36"
36
36
  },
37
- "gitHead": "7af7ba4fd7ec88e0d42ec3e36e3497e318f4cb37"
37
+ "gitHead": "d460f69b4dbc638edd9691912df3c52211d65c12"
38
38
  }