mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Fix order property is not respected if set more than once
This commit is contained in:
@@ -23,6 +23,9 @@ function setLayoutParamsProperty(view: View, setter: (lp: org.nativescript.widge
|
||||
|
||||
export function _onNativeOrderPropertyChanged(view: View, newValue: number): void {
|
||||
setLayoutParamsProperty(view, lp => lp.order = newValue);
|
||||
if (view.parent && view.parent instanceof FlexboxLayout && view.parent.android) {
|
||||
view.parent.android.invalidateOrdersCache();
|
||||
}
|
||||
}
|
||||
|
||||
export function _onNativeFlexGrowPropertyChanged(view: View, newValue: number): void {
|
||||
@@ -106,6 +109,10 @@ export class FlexboxLayout extends FlexboxLayoutBase {
|
||||
this._layout = new org.nativescript.widgets.FlexboxLayout(this._context);
|
||||
}
|
||||
|
||||
_invalidateOrdersCache() {
|
||||
this._nativeView.invalidateOrdersCache();
|
||||
}
|
||||
|
||||
_setNativeFlexDirection(flexDirection: FlexDirection) {
|
||||
let value = flexDirectionMap[flexDirection];
|
||||
this.android.setFlexDirection(value);
|
||||
|
||||
Reference in New Issue
Block a user