Skip to content

fix(TextBox): Avoid NRE on Android on virtual keyboard enter#13527

Merged
MartinZikmund merged 2 commits intomasterfrom
dev/mazi/android-enterkey
Sep 8, 2023
Merged

fix(TextBox): Avoid NRE on Android on virtual keyboard enter#13527
MartinZikmund merged 2 commits intomasterfrom
dev/mazi/android-enterkey

Conversation

@MartinZikmund
Copy link
Member

@MartinZikmund MartinZikmund commented Sep 6, 2023

GitHub Issue (If applicable): closes #13509

PR Type

What kind of change does this PR introduce?

  • Bugfix

What is the current behavior?

NRE on Enter

What is the new behavior?

No NRE

Copilot Summary

🤖 Generated by Copilot at 0302121

Fix KeyUp event bug for TextBox on Android with physical keyboard. Add null check and default value for e and modifiers in OnEditorAction method in TextBox.Android.cs.

PR Checklist

Please check if your PR fulfills the following requirements:

Other information

Internal Issue (If applicable):

@github-actions github-actions bot added the platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform label Sep 6, 2023
@MartinZikmund
Copy link
Member Author

@Mergifyio backport legacy/4x

@mergify
Copy link
Contributor

mergify bot commented Sep 6, 2023

backport legacy/4x

✅ Backports have been created

Details

@jeromelaban
Copy link
Member

@MartinZikmund the build error will be fixed by #13521

@nventive-devops
Copy link
Contributor

The build 93506 found UI Test snapshots differences: android-28-net7: 0, android-28-net7-Snap: 79, ios: 33, ios-Snap: 143, skia-gtk-screenshots: 77, skia-wpf-screenshots: 92, wasm: 102, wasm-automated-net7.0-UWP-Benchmarks: 0, wasm-automated-net7.0-UWP-Default: 121, wasm-automated-net7.0-UWP-RuntimeTests: 0, wasm-automated-net7.0-WinUI-RuntimeTests: 0

Details
  • android-28-net7: 0 changed over 1

  • android-28-net7-Snap: 79 changed over 1045

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Grid_Grid_in_GridClipping_Uno_UI_Samples_Content_UITests_GridTestsControl_Grid_in_GridClipping
    • ListView_HorizontalListViewGrouped_SamplesApp_Windows_UI_Xaml_Controls_ListView_HorizontalListViewGrouped
    • ListView_ListViewScrollIntoViewSnapPoints_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewScrollIntoViewSnapPoints
    • LoopingSelector_UITests_Windows_UI_Xaml_Controls_LoopingSelectorTests_LoopingSelector_Short_UITests_Windows_UI_Xaml_Controls_LoopingSelectorTests_LoopingSelector_Short
    • MediaPlayerElement_MediaPlayerElement_Stretch_Fill_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Stretch_Fill
    • MUX_UITests_Microsoft_UI_Xaml_Controls_SplitButtonTests_SplitButtonPage_UITests_Microsoft_UI_Xaml_Controls_SplitButtonTests_SplitButtonPage
    • MUX_UITests_Shared_Microsoft_UI_Xaml_Controls_TreeViewTests_TreeViewPage_UITests_Shared_Microsoft_UI_Xaml_Controls_TreeViewTests_TreeViewPage
    • NavigationView_FluentStyle_NavigationViewSample_SamplesApp_Samples_Microsoft_UI_Xaml_Controls_NavigationViewTests_FluentStyle_FluentStyle_NavigationViewSample
    • Brushes_BorderImageBrush_Uno_UI_Samples_UITests_ImageBrushTestControl_BorderImageBrush
    • Default_SamplesApp_Wasm_Windows_UI_Xaml_Controls_ListView_ListView_IsSelected_SamplesApp_Wasm_Windows_UI_Xaml_Controls_ListView_ListView_IsSelected
    • MediaPlayerElement_Mini_player_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Minimal
    • MUX_NumberBox_UITests_Shared_Microsoft_UI_Xaml_Controls_NumberBoxTests_NumberBoxPage
    • Progress_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • Clipping_UITests_Shared_Windows_UI_Xaml_Clipping_ClippingToControlBounds_UITests_Shared_Windows_UI_Xaml_Clipping_ClippingToControlBounds
    • Image_UITests_Windows_UI_Xaml_Controls_ImageTests_SvgImageSource_Icons_UITests_Windows_UI_Xaml_Controls_ImageTests_SvgImageSource_Icons
    • Image_UITests_Windows_UI_Xaml_Controls_ImageTests_SvgImageSource_NoSize_UITests_Windows_UI_Xaml_Controls_ImageTests_SvgImageSource_NoSize
    • RatingControl_UITests_Microsoft_UI_Xaml_Controls_RatingControlTests_RatingControlPage_UITests_Microsoft_UI_Xaml_Controls_RatingControlTests_RatingControlPage
    • TabView_UITests_Microsoft_UI_Xaml_Controls_TabViewTests_TabViewPage_UITests_Microsoft_UI_Xaml_Controls_TabViewTests_TabViewPage
    • Grid_Grid_Auto_Text_Block_Trimming_Uno_UI_Samples_Content_UITests_GridTestsControl_Grid_Auto_Text_Block_Trimming
    • Image_ImageSourceStream_Uno_UI_Samples_UITests_ImageTestsControl_ImageSourceStream
  • ios: 33 changed over 270

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Flyout_ShowAt_Window_Content_UITests_Windows_UI_Xaml_Controls_FlyoutTests_Flyout_ShowAt_Window_Content
    • Keyboard_Textbox_NoScrollViewer_Validation_4_-_Remove_Focus_on_multilineTextBox
    • Screenshots_Image_Stretch_Alignment_SizeOnControl_Mode-2
    • ProgressRing_Visibility_Collapsed_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • ComboBoxTests_ToggleDisabled_ComboBox_Disabled
    • Keyboard_Textbox_NoScrollViewer_Validation_1_-_Remove_Focus_on_filledTextBox
    • When_MultipleSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • ScrollViewer_WhenSync_RunNormalAndCompletesWithNonIntermediate_UITests_Shared_Windows_UI_Xaml_Controls_ScrollViewerTests_ScrollViewer_UpdatesMode
    • SequentialAnimations_SamplesApp_Windows_UI_Xaml_Media_Animation_SequentialAnimationsPage
    • When_ExtendedSelectionWithoutItemClick_Then_PointersEvents_UITests_Windows_UI_Xaml_Controls_ListView_ListView_Selection_Pointers
    • ComboBoxTests_ToggleDisabled_ComboBox_Enabled
    • ComboBoxTests_ToggleDisabled_UITests_Windows_UI_Xaml_Controls_ComboBox_ComboBox_ToggleDisabled
    • Keyboard_Textbox_NoScrollViewer_Validation_5_-_Remove_Focus_on_numberTextBox
    • ListView_ObservableCollection_Creation_Count_Added
    • ListView_ObservableCollection_Creation_Count_Scrolled1
    • ListView_ObservableCollection_Creation_Count_Scrolled2
    • ProgressRing_IsEnabled_Running_UITests_Windows_UI_Xaml_Controls_ProgressRing_WindowsProgressRing_GH1220
    • Screenshots_Image_Stretch_Alignment_SizeOnControl_Mode-1
    • ScrollViewer_WhenAsync_RunIdleAndCompletesWithNonIntermediate_UITests_Shared_Windows_UI_Xaml_Controls_ScrollViewerTests_ScrollViewer_UpdatesMode
    • XamlCommandBar_Automated_AfterClickMe
  • ios-Snap: 143 changed over 1036

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Border_AutoBorderStretchwithtopmargin_Uno_UI_Samples_UITests_BorderTestsControl_AutoBorderStretchwithtopmargin
    • Dialogs_UITests_Shared_MessageDialogTests_MessageDialogTest_UITests_Shared_MessageDialogTests_MessageDialogTest
    • Gesture_Recognizer_UITests_Shared_Windows_UI_Input_GestureRecognizerTests_GestureEventsCommons_UITests_Shared_Windows_UI_Input_GestureRecognizerTests_GestureEventsCommons
    • ListView_ListViewFirstVisibleIndex_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewFirstVisibleIndex
    • ListView_UITests_Windows_UI_Xaml_Controls_ListView_ListView_DuplicateItem_UITests_Windows_UI_Xaml_Controls_ListView_ListView_DuplicateItem
    • RatingControl_UITests_Microsoft_UI_Xaml_Controls_RatingControlTests_RatingControlPage_UITests_Microsoft_UI_Xaml_Controls_RatingControlTests_RatingControlPage
    • ComboBox_ComboBox_Legacy_SamplesApp_Wasm_Windows_UI_Xaml_Controls_ComboBox_ComboBox_Legacy
    • Image_ImageSourceUrlMsAppxScheme_Uno_UI_Samples_UITests_ImageTests_ImageSourceUrlMsAppxScheme
    • TextBlock_SimpleText_MaxLines_Two_With_Wrap_And_Trim_Uno_UI_Samples_Content_UITests_TextBlockControl_SimpleText_MaxLines_Two_With_Wrap_And_Trim
    • ComboBox_ComboBox_NativePopup_SamplesApp_Wasm_Windows_UI_Xaml_Controls_ComboBox_ComboBox_NativePopup
    • CommandBar_CommandBar_Xaml_Automated_UITests_Shared_Windows_UI_Xaml_Controls_CommandBar_CommandBar_Xaml_Automated
    • Gesture_Recognizer_VisualStates_TextBox_UITests_Shared_Windows_UI_Input_VisualStatesTests_TextBox_VisualStates
    • Icons_UITests_Microsoft_UI_Xaml_Controls_ImageIconTests_ImageIconPage_UITests_Microsoft_UI_Xaml_Controls_ImageIconTests_ImageIconPage
    • ItemsRepeater_UITests_Windows_UI_Xaml_Controls_Repeater_ItemsRepeater_Nested_UITests_Windows_UI_Xaml_Controls_Repeater_ItemsRepeater_Nested
    • ListView_ListViewGroupedVariableHeightComplexTemplate_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewGroupedVariableHeightComplexTemplate
    • ListView_ListView_Explicit_Items_UITests_Shared_Windows_UI_Xaml_Controls_ListView_ListView_Explicit_Items
    • ListView_ListView_Image_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListView_Image
    • MUX_MUXControlsTestApp_RefreshVisualizerPage_MUXControlsTestApp_RefreshVisualizerPage
    • Path_PathVerticalOffsetAdjustable_SamplesApp_Windows_UI_Xaml_Shapes_PathTestsControl_PathVerticalOffsetAdjustable
    • TextBlock_TextBlock_CharacterSpacing_Uno_UI_Samples_Content_UITests_TextBlockControl_TextBlock_CharacterSpacing
  • skia-gtk-screenshots: 77 changed over 1123

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Clipping-UIElement_Clipping.png
    • MediaPlayerElement-MediaPlayerElement_Stretch_Fill.png
    • NavigationView-NavigationViewCustomThemeResourcesPage.png
    • NavigationView-NavigationViewItemTemplatePage.png
    • Border-Border_Clipped_Change_Property.png
    • Gesture Recognizer-HoldingTests.png
    • Gesture Recognizer-Manipulation_Basics.png
    • ListView-ListView_DataTemplateSelector.png
    • MUX-PagerControlPage.png
    • MUX-PersonPicturePage.png
    • PersonPicture-PersonPicturePage.png
    • MUX-NavigationViewCustomThemeResourcesPage.png
    • MUX-NavigationViewItemTemplatePage.png
    • MUX-NavigationViewRS4Page.png
    • ListView-ListView_Margin_On_Container.png
    • NavigationView-FluentStyle_NavigationViewSample.png
    • PagerControl-PagerControlPage.png
    • Pivot-Pivot_CustomContent_Automated.png
    • Focus-Focus_FocusCycle.png
    • Gesture Recognizer-DoubleTappedTests.png
  • skia-wpf-screenshots: 92 changed over 1123

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • BreadcrumbBar-BreadcrumbBarPage.png
    • Clipping-Transform_Ellipse_in_two_grids.png
    • ListView-ListViewLegacy.png
    • ListView-ListView_SelectedItem.png
    • ListView-ListView_Selection_Events.png
    • MUX-NavigationViewItemTemplatePage.png
    • PipsPager-PipsPagerExamples.png
    • Pivot-Basics Pivot Test.png
    • Border-Border_Clipped_Change_Property.png
    • Focus-FocusManagerTest.png
    • GridView-GridViewGroupedResizable.png
    • Image-SvgImageSource_Basic.png
    • ListView-ListViewGroupedLarge.png
    • ListView-ListViewGroupedLargeLegacy.png
    • ListView-ListViewGrouped.png
    • MUX-WinUIProgressRingPage.png
    • MUX-WinUIProgressRing_CustomSources.png
    • NavigationView-NavigationViewTopNavPage.png
    • Scrolling-ScrollViewer_Margin_Centered.png
    • Clipping-PanelChildrenClipping.png
  • wasm: 102 changed over 1042

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • MUXControlsTestApp.PersonPicturePage
    • SamplesApp.Windows_UI_Xaml.Clipping.Transform_Ellipse_In_Border
    • SamplesApp.Windows_UI_Xaml.Clipping.Transform_Ellipse_in_Canvas
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListViewSelectedItems
    • SamplesApp.Windows_UI_Xaml_Media.Geometry.LineSegmentPage
    • SamplesApp.Windows_UI_Xaml_Shapes.PathTestsControl.StretchUniformHorizontalAlignmentCenter
    • UITests.Shared.Windows_UI_Xaml_Controls.ViewBoxTests.ViewBox_Alignment
    • UITests.Windows_UI_Xaml.DragAndDrop.DragDrop_TestPage
    • UITests.Windows_UI_Xaml.FocusTests.Focus_FocusCycle
    • UITests.Windows_UI_Xaml_Controls.ScrollViewerTests.ScrollViewer_Margin_Centered
    • initial_state
    • SamplesApp.Wasm.Windows_UI_Xaml_Media.Transform.Polygon_With_RotateTransform
    • SamplesApp.Windows_UI_Xaml_Shapes.PathTestsControl.PathVerticalOffset
    • SamplesApp.Windows_UI_Xaml_Shapes.PathTestsControl.PathVerticalOffsetAdjustable
    • UITests.Shared.Windows_UI_Input.GestureRecognizer.PointersEvents
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_3gp_Extension
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Avi_Extension
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Flv_Extension
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Minimal
    • UITests.Uno_Web.Http.CookieManagerTests
  • wasm-automated-net7.0-UWP-Benchmarks: 0 changed over 1

  • wasm-automated-net7.0-UWP-Default: 121 changed over 1931

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Gesture_Recognizer_UITests_Shared_Windows_UI_Input_GestureRecognizerTests_RightTappedTests_UITests_Shared_Windows_UI_Input_GestureRecognizerTests_RightTappedTests
    • Gesture_Recognizer_UITests_Shared_Windows_UI_Input_GestureRecognizerTests_TappedTest_UITests_Shared_Windows_UI_Input_GestureRecognizerTests_TappedTest
    • Default_StrokeThickness_MyLine
    • Focus_UITests_Windows_UI_Xaml_FocusTests_Focus_FocusCycle_UITests_Windows_UI_Xaml_FocusTests_Focus_FocusCycle
    • MinMaxTest_UITests_Shared_Microsoft_UI_Xaml_Controls_NumberBoxTests_NumberBoxPage
    • ListView_ListView_DataTemplateSelector_UITests_Shared_Windows_UI_Xaml_Controls_ListView_ListView_DataTemplateSelector
    • ListView_ListView_Expandable_Item_Large_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListView_Expandable_Item_Large
    • Fonts_UITests_Windows_UI_Xaml_Media_FontTests_DynamicFont_UITests_Windows_UI_Xaml_Media_FontTests_DynamicFont
    • ListView_ListView_With_ListViews_Count_Measure_UITests_Shared_Windows_UI_Xaml_Controls_ListView_ListView_With_ListViews_Count_Measure
    • Border_UITests_Shared_Windows_UI_Xaml_Controls_BorderTests_Border_Clipped_Change_Property_UITests_Shared_Windows_UI_Xaml_Controls_BorderTests_Border_Clipped_Change_Property
    • Brushes_Uno_UI_Samples_Samples_Shared_Content_UITests_ImageBrushInList_Uno_UI_Samples_Samples_Shared_Content_UITests_ImageBrushInList
    • DatePicker_Flyout_DatePicker_-_Flyout
    • Icons_UITests_Microsoft_UI_Xaml_Controls_ImageIconTests_ImageIconPage_UITests_Microsoft_UI_Xaml_Controls_ImageIconTests_ImageIconPage
    • Grid_Grid_with_Stack_Panel_and_Trimming_Uno_UI_Samples_Content_UITests_GridTestsControl_Grid_with_Stack_Panel_and_Trimming
    • Image_UITests_Windows_UI_Xaml_Controls_ImageTests_SvgImageSource_NoSize_UITests_Windows_UI_Xaml_Controls_ImageTests_SvgImageSource_NoSize
    • LineSegment_SamplesApp_Windows_UI_Xaml_Media_Geometry_LineSegmentPage
    • ListView_ListViewVariableItemHeight_SamplesApp_Windows_UI_Xaml_Controls_ListView_ListViewVariableItemHeight
    • MediaPlayerElement_Using_ogg_UITests_Shared_Windows_UI_Xaml_Controls_MediaPlayerElement_MediaPlayerElement_Ogg_Extension
    • Path_PathVerticalOffsetAdjustable_SamplesApp_Windows_UI_Xaml_Shapes_PathTestsControl_PathVerticalOffsetAdjustable
    • Path_PathVerticalOffsetII_SamplesApp_Windows_UI_Xaml_Shapes_PathTestsControl_PathVerticalOffsetII
  • wasm-automated-net7.0-UWP-RuntimeTests: 0 changed over 1

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Droid] NRE when Enter press on virtual keyboard using latest uno dev

3 participants