Skip to content

fix(core): Added missing length property equality comparers #10689

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/core/ui/image/image-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,15 @@ tintColorProperty.register(Style);
export const decodeHeightProperty = new Property<ImageBase, CoreTypes.LengthType>({
name: 'decodeHeight',
defaultValue: { value: 0, unit: 'dip' },
equalityComparer: Length.equals,
valueConverter: Length.parse,
});
decodeHeightProperty.register(ImageBase);

export const decodeWidthProperty = new Property<ImageBase, CoreTypes.LengthType>({
name: 'decodeWidth',
defaultValue: { value: 0, unit: 'dip' },
equalityComparer: Length.equals,
valueConverter: Length.parse,
});
decodeWidthProperty.register(ImageBase);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ export const leftProperty = new Property<View, CoreTypes.LengthType>({
layout.onLeftChanged(target, oldValue, newValue);
}
},
valueConverter: (v) => Length.parse(v),
equalityComparer: Length.equals,
valueConverter: Length.parse,
});
leftProperty.register(View);

Expand All @@ -75,6 +76,7 @@ export const topProperty = new Property<View, CoreTypes.LengthType>({
layout.onTopChanged(target, oldValue, newValue);
}
},
valueConverter: (v) => Length.parse(v),
equalityComparer: Length.equals,
valueConverter: Length.parse,
});
topProperty.register(View);
6 changes: 4 additions & 2 deletions packages/core/ui/layouts/wrap-layout/wrap-layout-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ export const itemWidthProperty = new Property<WrapLayoutBase, CoreTypes.LengthTy
name: 'itemWidth',
defaultValue: 'auto',
affectsLayout: __APPLE__,
valueConverter: (v) => Length.parse(v),
equalityComparer: Length.equals,
valueConverter: Length.parse,
valueChanged: (target, oldValue, newValue) => (target.effectiveItemWidth = Length.toDevicePixels(newValue, -1)),
});
itemWidthProperty.register(WrapLayoutBase);
Expand All @@ -31,7 +32,8 @@ export const itemHeightProperty = new Property<WrapLayoutBase, CoreTypes.LengthT
name: 'itemHeight',
defaultValue: 'auto',
affectsLayout: __APPLE__,
valueConverter: (v) => Length.parse(v),
equalityComparer: Length.equals,
valueConverter: Length.parse,
valueChanged: (target, oldValue, newValue) => (target.effectiveItemHeight = Length.toDevicePixels(newValue, -1)),
});
itemHeightProperty.register(WrapLayoutBase);
Expand Down
2 changes: 1 addition & 1 deletion packages/core/ui/list-view/index.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ export class ListView extends ListViewBase {
}
[iosEstimatedRowHeightProperty.setNative](value: CoreTypes.LengthType) {
const nativeView = this.nativeViewProtected;
const estimatedHeight = Length.toDevicePixels(value, 0);
const estimatedHeight = layout.toDeviceIndependentPixels(Length.toDevicePixels(value, 0));
nativeView.estimatedRowHeight = estimatedHeight < 0 ? DEFAULT_HEIGHT : estimatedHeight;
}
}
3 changes: 2 additions & 1 deletion packages/core/ui/list-view/list-view-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@ rowHeightProperty.register(ListViewBase);

export const iosEstimatedRowHeightProperty = new Property<ListViewBase, CoreTypes.LengthType>({
name: 'iosEstimatedRowHeight',
valueConverter: (v) => Length.parse(v),
equalityComparer: Length.equals,
valueConverter: Length.parse,
});
iosEstimatedRowHeightProperty.register(ListViewBase);

Expand Down
Loading