Skip to content

Commit a1e69f3

Browse files
committed
fix: use verticalTextAlignment instead of verticalAlignment
1 parent abc93e9 commit a1e69f3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Diff for: src/label-common.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { Style } from 'tns-core-modules/ui/styling/style';
55
import { CssProperty, InheritedCssProperty, makeParser, makeValidator, Property } from 'tns-core-modules/ui/core/properties';
66
import { isIOS } from 'tns-core-modules/platform';
77
import { layout } from 'tns-core-modules/utils/utils';
8-
// import { CssProperty, InheritedCssProperty, makeParser, makeValidator, Property } from "../core/properties";
98

109
export const cssProperty = (target: Object, key: string | symbol) => {
1110
// property getter
@@ -30,6 +29,7 @@ export const cssProperty = (target: Object, key: string | symbol) => {
3029
export class LabelBase extends TNLabel implements HtmlViewDefinition {
3130
@cssProperty maxLines: string | number;
3231
@cssProperty autoFontSize: boolean;
32+
@cssProperty verticalTextAlignmentgnment: VerticalTextAlignment;
3333
public html: string;
3434
}
3535

@@ -82,10 +82,10 @@ textShadowProperty.register(Style);
8282
export type VerticalTextAlignment = 'initial' | 'top' | 'middle' | 'bottom';
8383

8484
const textAlignmentConverter = makeParser<VerticalTextAlignment>(makeValidator<VerticalTextAlignment>('initial', 'top', 'middle', 'bottom'));
85-
export const textAlignmentProperty = new InheritedCssProperty<Style, VerticalTextAlignment>({
85+
export const verticalTextAlignmentProperty = new InheritedCssProperty<Style, VerticalTextAlignment>({
8686
name: 'verticalTextAlignment',
8787
cssName: 'vertical-text-align',
8888
defaultValue: 'initial',
8989
valueConverter: textAlignmentConverter
9090
});
91-
textAlignmentProperty.register(Style);
91+
verticalTextAlignmentProperty.register(Style);

Diff for: src/label.ios.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ class ObserverClass extends NSObject {
7474
const inset = owner.nativeViewProtected.textContainerInset;
7575
const top = layout.toDeviceIndependentPixels(owner.effectivePaddingTop + owner.effectiveBorderTopWidth);
7676

77-
switch (owner.verticalAlignment) {
78-
case 'stretch': // not supported
77+
switch (owner.verticalTextAlignmentgnment) {
78+
case 'initial': // not supported
7979
case 'top':
8080
owner.nativeViewProtected.textContainerInset = {
8181
top,

0 commit comments

Comments
 (0)