Skip to content

Fix AG_E_LAYOUT_CYCLE crash in widgets due to MinHeight exceeding Max Height#9340

Open
pranav-gupta-msft wants to merge 1 commit intomainfrom
users/pragupta/bug61024268-v0.001
Open

Fix AG_E_LAYOUT_CYCLE crash in widgets due to MinHeight exceeding Max Height#9340
pranav-gupta-msft wants to merge 1 commit intomainfrom
users/pragupta/bug61024268-v0.001

Conversation

@pranav-gupta-msft
Copy link
Member

When rendering adaptive cards in widgets with fixed dimensions, setting a MinHeight value greater than the MaxHeight constraint caused XAML to throw AG_E_LAYOUT_CYCLE (0x802B0014), resulting in widget crashes.

Changes:

  • XamlBuilder.cpp: Clamp card MinHeight to not exceed fixed height when fixedDimensions are set, preventing impossible layout constraints
  • AdaptiveCarouselRenderer.cpp: Apply same constraint validation for carousel elements with HeightInPixels property

The fix ensures MinHeight never exceeds MaxHeight by automatically clamping the value to the maximum allowed height, allowing cards to render successfully without layout cycle errors.

…Height

When rendering adaptive cards in widgets with fixed dimensions, setting
a MinHeight value greater than the MaxHeight constraint caused XAML to
throw AG_E_LAYOUT_CYCLE (0x802B0014), resulting in widget crashes.

Changes:
- XamlBuilder.cpp: Clamp card MinHeight to not exceed fixed height when
  fixedDimensions are set, preventing impossible layout constraints
- AdaptiveCarouselRenderer.cpp: Apply same constraint validation for
  carousel elements with HeightInPixels property

The fix ensures MinHeight never exceeds MaxHeight by automatically
clamping the value to the maximum allowed height, allowing cards to
render successfully without layout cycle errors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants