Skip to content

Commit 36763fd

Browse files
committed
fix: maxLines fix for latest N
1 parent c87a665 commit 36763fd

File tree

2 files changed

+13
-23
lines changed

2 files changed

+13
-23
lines changed

Diff for: src/label.android.ts

+9-10
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,17 @@ import {
3434
} from '@nativescript/core/ui/styling/style-properties';
3535
import {
3636
letterSpacingProperty,
37+
lineHeightProperty,
3738
textAlignmentProperty,
3839
textDecorationProperty,
3940
textTransformProperty,
4041
whiteSpaceProperty
4142
} from '@nativescript/core/ui/text-base';
42-
import { lineHeightProperty } from '@nativescript/core/ui/text-base/text-base-common';
43-
import { layout } from '@nativescript/core/utils/utils';
44-
import { Label as LabelViewDefinition, LineBreak, TextShadow } from './label';
45-
import {
46-
autoFontSizeProperty,
47-
lineBreakProperty,
48-
maxLinesProperty,
49-
selectableProperty,
50-
textShadowProperty
51-
} from './label-common';
43+
import { maxLinesProperty } from '@nativescript/core/ui/text-base/text-base-common';
5244
import lazy from '@nativescript/core/utils/lazy';
45+
import { layout } from '@nativescript/core/utils/utils';
46+
import { Label as LabelViewDefinition, LineBreak } from './label';
47+
import { autoFontSizeProperty, lineBreakProperty, selectableProperty, textShadowProperty } from './label-common';
5348

5449
export { createNativeAttributedString, enableIOSDTCoreText } from '@nativescript-community/text';
5550
export * from './label-common';
@@ -195,6 +190,8 @@ abstract class LabelBase extends View implements LabelViewDefinition {
195190
public html: string;
196191
@cssProperty selectable: boolean;
197192

193+
_isSingleLine: boolean;
194+
198195
public mIsSingleLine: boolean;
199196

200197
public text: string;
@@ -217,6 +214,8 @@ abstract class LabelBase extends View implements LabelViewDefinition {
217214
@cssProperty lineBreak: LineBreak;
218215
@cssProperty textAlignment: CoreTypes.TextAlignmentType;
219216
@cssProperty textDecoration: CoreTypes.TextDecorationType;
217+
218+
//@ts-ignore
220219
@cssProperty textTransform: CoreTypes.TextTransformType;
221220
@cssProperty whiteSpace: CoreTypes.WhiteSpaceType;
222221

Diff for: src/label.ios.ts

+4-13
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
1-
import {
2-
LightFormattedString,
3-
VerticalTextAlignment,
4-
computeBaseLineOffset,
5-
createNativeAttributedString,
6-
usingIOSDTCoreText,
7-
verticalTextAlignmentProperty
8-
} from '@nativescript-community/text';
9-
import { Color, CoreTypes, Font, FormattedString, Span, View } from '@nativescript/core';
1+
import { VerticalTextAlignment, createNativeAttributedString, verticalTextAlignmentProperty } from '@nativescript-community/text';
2+
import { Color, CoreTypes, Font, FormattedString, View } from '@nativescript/core';
103
import {
114
borderBottomWidthProperty,
125
borderLeftWidthProperty,
136
borderRightWidthProperty,
147
borderTopWidthProperty,
15-
colorProperty,
168
fontInternalProperty,
179
paddingBottomProperty,
1810
paddingLeftProperty,
@@ -22,10 +14,10 @@ import {
2214
import {
2315
formattedTextProperty,
2416
letterSpacingProperty,
25-
textDecorationProperty,
17+
lineHeightProperty,
2618
whiteSpaceProperty
2719
} from '@nativescript/core/ui/text-base';
28-
import { getClosestPropertyValue, lineHeightProperty } from '@nativescript/core/ui/text-base/text-base-common';
20+
import { maxLinesProperty } from '@nativescript/core/ui/text-base/text-base-common';
2921
import { isNullOrUndefined, isString } from '@nativescript/core/utils/types';
3022
import { iOSNativeHelper, layout } from '@nativescript/core/utils/utils';
3123
import { TextShadow } from './label';
@@ -36,7 +28,6 @@ import {
3628
lineBreakProperty,
3729
linkColorProperty,
3830
linkUnderlineProperty,
39-
maxLinesProperty,
4031
needFormattedStringComputation,
4132
selectableProperty,
4233
textShadowProperty

0 commit comments

Comments
 (0)