You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Computes the layout of the view's children, if any.pubfndefault_compute_layout(id:ViewId,cx:&mutComputeLayoutCx) -> Option<Rect>{letmut layout_rect:Option<Rect> = None;for child in id.children(){if !child.style_has_hidden(){// <-- Add thislet child_layout = cx.compute_view_layout(child);ifletSome(child_layout) = child_layout {ifletSome(rect) = layout_rect {
layout_rect = Some(rect.union(child_layout));}else{
layout_rect = Some(child_layout);}}}}
layout_rect
}
The problem was: when the tab was marked as hidden (on tab change) it still has had it's layout computed. It was given a size of zero and when the scroll view saw that it's size has been updated it was changing the scroll offset.
The solution is: to not call compute layout on a hidden view.
The text was updated successfully, but these errors were encountered:
I was having an issue with scrolled view on tab, that on change always was going back to the top.
After some digging @jrmoulton has found the fix:
The problem was: when the tab was marked as hidden (on tab change) it still has had it's layout computed. It was given a size of zero and when the scroll view saw that it's size has been updated it was changing the scroll offset.
The solution is: to not call compute layout on a hidden view.
The text was updated successfully, but these errors were encountered: