Open jalbatross opened 4 years ago
Please change your array to a Set
and also bind property change event (remember to clean them up afterward!)
parent.on(Observable.propertyChangeEvent, (propertyChangeData: PropertyChangeData) => {
if(propertySet.has(propertyChangeData.propertyName)) {
this.wrapper[propertyChangeData.propertyName] = propertyChangeData.value;
}
});
To clean it up you should probably move that anonymous function to a named function and call:
parent.on(Observable.propertyChangeEvent, this.myfunction, this);
and clean up with:
parent.off(Observable.propertyChangeEvent, this.myfunction,this);
For layouts which use the position of the child element in the layout structure as the element's position (StackLayout, for example), the plugin works fine. However, for layouts where child node position may not have any correlation to the element's rendered UI (GridLayout, AbsoluteLayout, etc.), you end up running into problems.
For example, take the following layout on iOS:
Under the hood, this happens:
So the second label does not render correctly.
Currently this PR just applies the row, column, rowSpan, and colSpan attributes to the wrapping StackLayout if the original element is wrapped in a GridLayout.
More work needs to be done so that the wrapping StackLayout gets the correct attributes from the original element in order to render in the view correctly for all layouts - I believe #17 was caused by a similar issue for AbsoluteLayouts.
As-is, this is mergeable but does not account for all possible use cases.