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

fix: Workaround non-UIElement UIViews in Grid layout #18470

Merged
merged 1 commit into from
Oct 16, 2024

Conversation

MartinZikmund
Copy link
Member

@MartinZikmund MartinZikmund commented Oct 15, 2024

GitHub Issue (If applicable): closes #17997, closes #14013

PR Type

What kind of change does this PR introduce?

  • Bugfix

What is the current behavior?

Focusing a text input on iOS causes the framework to temporarily add a non-UIElement child to the parent's Grid, which is then surfaced to the Grid as a null

What is the new behavior?

No longer crashing. This is a workaround, ideally we would want to ensure that Children as a UIElementCollection only reflects the actual UIElements in the ChildrenShadow. This however means more complex logic to properly handle indexes, etc. This workaround seems to be sufficient for now to handle the cases we encountered. Created #18474 to track this

PR Checklist

Please check if your PR fulfills the following requirements:

Other information

Internal Issue (If applicable):

@unodevops
Copy link
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-18470/index.html

@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-18470/index.html

@jeromelaban
Copy link
Member

@Mergifyio backport release/stable/5.5

@jeromelaban
Copy link
Member

@Mergifyio backport release/stable/5.4

Copy link
Contributor

mergify bot commented Oct 15, 2024

backport release/stable/5.5

✅ Backports have been created

Copy link
Contributor

mergify bot commented Oct 15, 2024

backport release/stable/5.4

✅ Backports have been created

@nventive-devops
Copy link
Contributor

The build 143618 found UI Test snapshots differences: android-28-net8: 15, android-28-net8-Snap: 50, ios: 9, ios-Snap: 46, skia-gtk-screenshots: 71, skia-linux-screenshots: 50, skia-windows-screenshots: 68, wasm: 450, wasm-automated-net9.0-UWP-Default-automated: 18, wasm-automated-net9.0-UWP-RuntimeTests-0: 0, wasm-automated-net9.0-UWP-RuntimeTests-1: 0, wasm-automated-net9.0-UWP-RuntimeTests-2: 0, wasm-automated-net9.0-WinUI-Benchmarks-automated: 0, wasm-automated-net9.0-WinUI-RuntimeTests-0: 0, wasm-automated-net9.0-WinUI-RuntimeTests-1: 0, wasm-automated-net9.0-WinUI-RuntimeTests-2: 0

Details
  • android-28-net8: 15 changed over 829

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • DecimalFormatterTest_UITests_Shared_Microsoft_UI_Xaml_Controls_NumberBoxTests_NumberBoxPage
    • Detereminate_ProgressRing_Validation50_[#FF0000_#008000_#008000_#FF0000]_Progress-Ring-Value-50
    • ProgressRing_IsEnabled_Running_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • SequentialAnimations_SamplesApp_Windows_UI_Xaml_Media_Animation_SequentialAnimationsPage
    • ListView_SelectedItems_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewSelectedItems
    • ProgressRing_Visibility_Collapsed_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • UpDownEnabledTest_UITests_Shared_Microsoft_UI_Xaml_Controls_NumberBoxTests_NumberBoxPage
    • When_SingleSelectionWithItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • Detereminate_ProgressRing_Validation25_[#FF0000_#008000_#FF0000_#FF0000]_Progress-Ring-Value-25
    • Detereminate_ProgressRing_Validation75_[#FF0000_#008000_#008000_#008000]_Progress-Ring-Value-75
    • When_ExtendedSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • When_NoSelectionWithItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • When_MultipleSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • When_Parent_PointerMoved_After_drag_on_non-scrolling_ScrollViewer
    • When_Parent_PointerMoved_After_drag_on_ScrollViewer_-_touch
  • android-28-net8-Snap: 50 changed over 1066

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Gesture_Recognizer_Pointer_Events_test_bench_UITests_Shared_Windows_UI_Input_GestureRecognizer_PointersEvents
    • MediaPlayerElement_Mini_player_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Minimal
    • SwipeControl_MUXControlsTestApp_SwipeControlPage2_MUXControlsTestApp_SwipeControlPage2
    • Default_Uno_UI_Samples_Content_UITests_WebView_WebView_AnchorNavigation_Uno_UI_Samples_Content_UITests_WebView_WebView_AnchorNavigation
    • Icons_UITests_Microsoft_UI_Xaml_Controls_ImageIconTests_ImageIconPage_UITests_Microsoft_UI_Xaml_Controls_ImageIconTests_ImageIconPage
    • RatingControl_UITests_Microsoft_UI_Xaml_Controls_RatingControlTests_RatingControlPage_UITests_Microsoft_UI_Xaml_Controls_RatingControlTests_RatingControlPage
    • TextBlock_SimpleText_MaxLines_Different_Font_Size_UITests_Shared_Windows_UI_Xaml_Controls_TextBlockControl_SimpleText_MaxLines_Different_Font_Size
    • TextBox_Input_Simple_Uno_UI_Samples_Content_UITests_TextBoxControl_Input_Simple
    • ListView_ListViewSelectedItems_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewSelectedItems
    • MediaPlayerElement_Using_3gp_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_3gp_Extension
    • MediaPlayerElement_Using_mp3_Audio_only_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Mp3_Extension
    • MediaPlayerElement_Using_ogg_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Ogg_Extension
    • Scrolling_MUXControlsTestApp_ScrollViewDynamicPage_MUXControlsTestApp_ScrollViewDynamicPage
    • Scrolling_MUXControlsTestApp_ScrollViewKeyboardAndGamepadNavigationPage_MUXControlsTestApp_ScrollViewKeyboardAndGamepadNavigationPage
    • TabView_UITests_Microsoft_UI_Xaml_Controls_TabViewTests_TabViewPage_UITests_Microsoft_UI_Xaml_Controls_TabViewTests_TabViewPage
    • TeachingTip_UITests_Microsoft_UI_Xaml_Controls_TeachingTipTests_TeachingTipPage_UITests_Microsoft_UI_Xaml_Controls_TeachingTipTests_TeachingTipPage
    • Shapes_UITests_Windows_UI_Xaml_Shapes_Rectangle_Rounding_UITests_Windows_UI_Xaml_Shapes_Rectangle_Rounding
    • Shapes_UITests_Windows_UI_Xaml_Shapes_PathStretchModes_UITests_Windows_UI_Xaml_Shapes_PathStretchModes
    • Shapes_UITests_Windows_UI_Xaml_Shapes_Path_Custom_UITests_Windows_UI_Xaml_Shapes_Path_Custom
    • Shapes_UITests_Windows_UI_Xaml_Shapes_Path_Geometries_UITests_Windows_UI_Xaml_Shapes_Path_Geometries
  • ios: 9 changed over 267

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ListView_SelectedItem_Both_Selection_Changed
    • ProgressRing_IsEnabled_Running_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • ProgressRing_Visibility_Collapsed_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • When_SingleSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • When_MultipleSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • TextBox_UpdatedBinding_On_OneWay_Mode_UITests_Windows_UI_Xaml_Controls_TextBox_TextBox_Bindings
    • Check_ListView_Swallows_Measure_UITests_Shared_Windows_UI_Xaml_Controls_ListView_ListView_With_ListViews_Count_Measure
    • SequentialAnimations_SamplesApp_Windows_UI_Xaml_Media_Animation_SequentialAnimationsPage
    • When_SingleSelectionWithItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
  • ios-Snap: 46 changed over 1057

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ListView_HorizontalListViewGrouped_SamplesApp_Windows_UI_Xaml_Controls_ListView_HorizontalListViewGrouped
    • Brushes_ImageBrushLocalAsset_Uno_UI_Samples_UITests_ImageBrushTestControl_ImageBrushLocalAsset
    • Brushes_Uno_UI_Samples_Samples_Shared_Content_UITests_ImageBrushInList_Uno_UI_Samples_Samples_Shared_Content_UITests_ImageBrushInList
    • ColorPicker_ColorPickerSample_UITests_Microsoft_UI_Xaml_Controls_ColorPickerTests_ColorPickerSample
    • Default_UITests_Windows_UI_Xaml_Controls_Canvas_Grid_ZIndex_UITests_Windows_UI_Xaml_Controls_Canvas_Grid_ZIndex
    • GridView_GenericApp_Views_Samples_Shared_Content_UITests_GridViewGrouped_GenericApp_Views_Samples_Shared_Content_UITests_GridViewGrouped
    • ListView_ListView_Image_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListView_Image
    • ListView_ListViewSelectedItems_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewSelectedItems
    • ListView_ListViewStackPanel_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewStackPanel
    • NavigationView_MUXControlsTestApp_NavigationViewMenuItemStretchPage_MUXControlsTestApp_NavigationViewMenuItemStretchPage
    • NavigationView_MUXControlsTestApp_NavigationViewMinimalPage_MUXControlsTestApp_NavigationViewMinimalPage
    • ListView_ListView_With_ListViews_Count_Measure_UITests_Shared_Windows_UI_Xaml_Controls_ListView_ListView_With_ListViews_Count_Measure
    • MediaPlayerElement_Sources_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Sources
    • NavigationView_MUXControlsTestApp_NavigationViewRS4Page_MUXControlsTestApp_NavigationViewRS4Page
    • TextBlock_TextBlockMultilineInStarStackPanel_Uno_UI_Samples_Content_UITests_TextBlockControl_TextBlockMultilineInStarStackPanel
    • TextBlock_TextBlock_FixedWidth_With_DataBound_Run_Uno_UI_Samples_Content_UITests_TextBlockControl_TextBlock_FixedWidth_With_DataBound_Run
    • Grid_Grid_DataBound_ColumnRow_Definitions_Uno_UI_Samples_Content_UITests_GridTestsControl_Grid_DataBound_ColumnRow_Definitions
    • Image_Uno_UI_Samples_UITests_Image_Image_Stretch_Alignment_Wider_Uno_UI_Samples_UITests_Image_Image_Stretch_Alignment_Wider
    • Image_Uno_UI_Samples_UITests_Image_Image_Stretch_Uno_UI_Samples_UITests_Image_Image_Stretch
    • Image_UITests_Shared_Windows_UI_Xaml_Controls_ImageTests_Image_Stretch_Algmnt_Inf_Horizontal_UITests_Shared_Windows_UI_Xaml_Controls_ImageTests_Image_Stretch_Algmnt_Inf_Horizontal
  • skia-gtk-screenshots: 71 changed over 2220

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ButtonClippingTestsControl.png
    • ImageBrush_UniformToFill.png
    • UIElement_MeasureDirtyPath.png-dark
    • UIElement_MeasureDirtyPath.png
    • BorderImageBrushRelativeTransform.png-dark
    • ImageBrushAlignmentXY.png
    • BorderImageBrushRelativeTransform.png
    • Popup_HVAlignments.png-dark
    • Popup_HVAlignments.png
    • ClipboardTests.png-dark
    • Buttons.png
    • Popup_Simple.png-dark
    • Popup_Simple.png
    • ImageBrushAlignmentXY2.png-dark
    • ImageBrushAlignmentXY2.png
    • Buttons.png-dark
    • PathImageBrushfill.png-dark
    • PathImageBrushfill.png
    • Ellipse.png-dark
    • Ellipse.png
  • skia-linux-screenshots: 50 changed over 2220

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Gamepad_CurrentReading.png-dark
    • CalendarView_Theming.png-dark
    • ClipboardTests.png-dark
    • DragDrop_TestPage.png-dark
    • DragDrop_TestPage.png
    • Gamepad_Enumeration.png-dark
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • DisplayInformation.png-dark
    • DisplayInformation.png
    • ClipboardTests.png
    • ContentPresenter_NativeEmbedding.png-dark
    • ContentPresenter_NativeEmbedding.png
    • ButtonClippingTestsControl.png-dark
    • Buttons.png-dark
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • ImageBrushAlignmentXY2.png
    • ImageBrush_SameWithDelay.png-dark
    • ImageBrush_SameWithDelay.png
  • skia-windows-screenshots: 68 changed over 2220

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Examples.png
    • Ellipse.png-dark
    • Ellipse.png
    • Gamepad_Enumeration.png-dark
    • Gamepad_Enumeration.png
    • ColorPickerSample.png-dark
    • ColorPickerSample.png
    • ImageBrushAlignmentXY2.png-dark
    • ImageBrushAlignmentXY2.png
    • ButtonClippingTestsControl.png-dark
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • Image_UseTargetSize.png-dark
    • Image_UseTargetSize.png
    • ButtonClippingTestsControl.png
    • Image_Stretch_None_ScrollViewer.png-dark
    • Image_Stretch_None_ScrollViewer.png
    • Buttons.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
  • wasm: 450 changed over 1044

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • MUXControlsTestApp.NavigationViewBlankPage1
    • MUXControlsTestApp.NavigationViewStretchPage
    • MUXControlsTestApp.RadialGradientBrushPage
    • SamplesApp.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_Static
    • SamplesApp.Wasm.Windows_UI_Xaml_Controls.ComboBox.ComboBox_Legacy
    • SamplesApp.Windows_UI_Xaml_Shapes.PathTestsControl.PathVerticalOffsetII
    • UITests.Microsoft_UI_Xaml_Controls.RadioButtonsTests.RadioButtonsInitialLoadSelected
    • UITests.Shared.Windows_UI_Input.GestureRecognizerTests.TransformationsHoverSibling
    • UITests.Shared.Windows_UI_Xaml.ThemeResources.BasicThemeResources
    • UITests.Shared.Windows_UI_Xaml.UIElementTests.Arrange_Performance01
    • UITests.Shared.Windows_UI_Xaml_Controls.Buttons_Native
    • UITests.Shared.Windows_UI_Xaml_Controls.GridTestsControl.Grid_with_MinWidthColumns
    • UITests.Shared.Windows_UI_Xaml_Controls.ImageTests.ImageSourceWriteableBitmapInvalidate
    • UITests.Shared.Windows_UI_Xaml_Controls.ImageTests.Image_ImageSource_PixelSize
    • UITests.Shared.Windows_UI_Xaml_Controls.TextBoxControl.TextBox_Binding_Null
    • UITests.Windows_UI_Input.GestureRecognizerTests.Manipulation_WithNestedElement
    • UITests.Windows_UI_Input.PointersTests.HitTest_Control
    • UITests.Windows_UI_Xaml_Controls.CalendarView.CalendarView_Theming
    • UITests.Windows_UI_Xaml_Controls.ListView.ListViewItem_IsEnabled
    • UITests.Windows_UI_Xaml_Controls.ListView.ListViewTemplateRootIsContainer
  • wasm-automated-net9.0-UWP-Default-automated: 18 changed over 1946

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ListView_ListViewSelectedItems_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewSelectedItems
    • Automation_UITests_Shared_Windows_UI_Xaml_Automation_AutomationProperties_Name_UITests_Shared_Windows_UI_Xaml_Automation_AutomationProperties_Name
    • Default_StrokeThickness_MyLine
    • MediaPlayerElement_Mini_player_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Minimal
    • MediaPlayerElement_Sources_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Sources
    • MediaPlayerElement_Using_3gp_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_3gp_Extension
    • MediaPlayerElement_Using_mp3_Audio_only_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Mp3_Extension
    • MediaPlayerElement_Using_ogg_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Ogg_Extension
    • ListView_SelectedItems_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewSelectedItems
    • Expander_WinUIExpanderPage_UITests_Shared_Microsoft_UI_Xaml_Controls_ExpanderTests_WinUIExpanderPage
    • Default_SamplesApp_Wasm_Windows_UI_Xaml_Controls_ListView_ListView_IsSelected_SamplesApp_Wasm_Windows_UI_Xaml_Controls_ListView_ListView_IsSelected
    • SequentialAnimations_SamplesApp_Windows_UI_Xaml_Media_Animation_SequentialAnimationsPage
    • When_NoSelectionWithItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • Pickers_UITests_Windows_UI_Xaml_Controls_CalendarView_CalendarView_Theming_UITests_Windows_UI_Xaml_Controls_CalendarView_CalendarView_Theming
    • TestProgressRing_InitialState_UITests_Microsoft_UI_Xaml_Controls_ProgressRing_WinUIProgressRing_Features
    • When_ExtendedSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • When_SingleSelectionWithItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • Windows_Media_MediaPlayer_UITests_Windows_Media_MediaPlayerTests
  • wasm-automated-net9.0-UWP-RuntimeTests-0: 0 changed over 1

  • wasm-automated-net9.0-UWP-RuntimeTests-1: 0 changed over 1

  • wasm-automated-net9.0-UWP-RuntimeTests-2: 0 changed over 1

  • wasm-automated-net9.0-WinUI-Benchmarks-automated: 0 changed over 1

  • wasm-automated-net9.0-WinUI-RuntimeTests-0: 0 changed over 1

  • wasm-automated-net9.0-WinUI-RuntimeTests-1: 0 changed over 1

  • wasm-automated-net9.0-WinUI-RuntimeTests-2: 0 changed over 1

@MartinZikmund MartinZikmund merged commit 4222366 into master Oct 16, 2024
106 checks passed
@MartinZikmund MartinZikmund deleted the dev/mazi/numberbox-break branch October 16, 2024 11:59
jeromelaban added a commit that referenced this pull request Oct 16, 2024
…5.5/pr-18470

fix: Workaround non-UIElement UIViews in Grid layout (backport #18470)
jeromelaban added a commit that referenced this pull request Oct 16, 2024
…5.4/pr-18470

fix: Workaround non-UIElement UIViews in Grid layout (backport #18470)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants