Skip to content
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

InvalidateMeasure in child triggers parent measure #3831

Closed
karthikraja-arumugam opened this issue Dec 22, 2021 · 7 comments
Closed

InvalidateMeasure in child triggers parent measure #3831

karthikraja-arumugam opened this issue Dec 22, 2021 · 7 comments
Assignees
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter delighter high It doesn't work at all, crashes or has a big impact. p/3 Work that is nice to have partner Issue or Request from a partner team platform/android 🤖 platform/iOS 🍎 platform/macOS 🍏 macOS / Mac Catalyst platform/windows 🪟 s/needs-info Issue needs more info from the author s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@karthikraja-arumugam
Copy link
Contributor

Description

In our custom control, we have a nested layout, in which if we call InvalidateMeasure for child element it triggers parent measure. This causes a loop in our implementation.

Sometimes InvalidateMeasure doesn't trigger the calling layout's measure itself.

Steps to Reproduce

TestSample.zip

  1. Run the attached sample. It has the below implementation
    Custom Control => Layout => Grid => ScrollView => DrawableView

  2. Press the InvalidateSize button, it will invalidate the layout measure and it triggers custom control (parent layout) measure.

Version with bug

Preview 11

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android, Windows, macOS

Affected platform versions

Android 9.0, Windows SDK 10.0.19041

Did you find any workaround?

No

Relevant log output

No response

@karthikraja-arumugam karthikraja-arumugam added the t/bug Something isn't working label Dec 22, 2021
@jsuarezruiz jsuarezruiz added the high It doesn't work at all, crashes or has a big impact. label Jan 31, 2022
@Eilon Eilon added the area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter label Feb 10, 2022
@wenwen60
Copy link

wenwen60 commented Feb 24, 2022

Reproduce on VS2022 17.2.0 Preview 2.0 [32215.517.main] using Android 11, attach repro sample
TestSample.zip.

@wenwen60 wenwen60 added the s/verified Verified / Reproducible Issue ready for Engineering Triage label Feb 24, 2022
@hartez hartez added this to the 6.0.300-servicing milestone Mar 22, 2022
@Redth Redth modified the milestones: 6.0.300-servicing, 6.0.300-rc.2 Mar 24, 2022
@hartez
Copy link
Contributor

hartez commented Mar 24, 2022

if we call InvalidateMeasure for child element it triggers parent measure

It is true that calling InvalidateMeasure() on a control may trigger the Measure of the parent control. That is expected behavior.

This causes a loop in our implementation.

I am not seeing a loop in the repro project you provided. Clicking the button calls the child's InvalidateMeasure(); the parent and child controls' Measure() methods are called, the controls are arranged, and the cycle ends.

Could you tell us why you are trying to call InvalidateMeasure() on a child control?

@davidortinau davidortinau added the partner Issue or Request from a partner team label Mar 31, 2022
@hartez hartez added the s/needs-info Issue needs more info from the author label Apr 14, 2022
@ghost
Copy link

ghost commented Apr 14, 2022

Hi @karthikraja-arumugam. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@ghost ghost added the s/no-recent-activity Issue has had no recent activity label Apr 18, 2022
@ghost
Copy link

ghost commented Apr 18, 2022

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

@hartez hartez modified the milestones: 6.0.300-rc.2, 6.0.300-rc.3 Apr 19, 2022
@ghost ghost added s/no-recent-activity Issue has had no recent activity and removed s/no-recent-activity Issue has had no recent activity labels Apr 19, 2022
@ghost
Copy link

ghost commented Apr 25, 2022

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

@Redth Redth modified the milestones: 6.0.300-rc.3, 6.0.300 Apr 27, 2022
@ghost ghost removed the s/no-recent-activity Issue has had no recent activity label Apr 27, 2022
@davidortinau davidortinau added the p/2 Work that is important, but is currently not scheduled for release label Apr 28, 2022
@samhouts samhouts modified the milestones: 6.0.300, 6.0.300-servicing Apr 28, 2022
@ghost ghost added the s/no-recent-activity Issue has had no recent activity label May 2, 2022
@ghost
Copy link

ghost commented May 2, 2022

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

@Redth Redth added the p/3 Work that is nice to have label May 3, 2022
@ghost ghost removed the s/no-recent-activity Issue has had no recent activity label May 3, 2022
@Redth Redth removed the p/2 Work that is important, but is currently not scheduled for release label May 3, 2022
@ghost ghost added the s/no-recent-activity Issue has had no recent activity label May 9, 2022
@ghost
Copy link

ghost commented May 9, 2022

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

@ghost ghost closed this as completed May 12, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Jun 11, 2022
@ghost ghost removed the s/no-recent-activity Issue has had no recent activity label Feb 1, 2024
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter delighter high It doesn't work at all, crashes or has a big impact. p/3 Work that is nice to have partner Issue or Request from a partner team platform/android 🤖 platform/iOS 🍎 platform/macOS 🍏 macOS / Mac Catalyst platform/windows 🪟 s/needs-info Issue needs more info from the author s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants