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

Don't run hide on tapped code if window is null #17758

Merged
merged 1 commit into from Oct 2, 2023
Merged

Don't run hide on tapped code if window is null #17758

merged 1 commit into from Oct 2, 2023

Conversation

PureWeen
Copy link
Member

@PureWeen PureWeen commented Sep 30, 2023

Description of Change

If navigation isn't animated the navigated event will sometimes fire on the incoming page before IsFocused has transitioned to false on the previous page. This could also happen if there's a bug with Focus propagation so it's important to guard against window being null.

Points to consider around if we should backport.

  • the crash will only happen on android if you enable HideSoftInputOnTapped which is new functionality added for NET8
  • It only crashes when navigating backwards without animation. By default, shell navigates back without animation if you don't use the parameter to tell it to use animation.
  • technically you can work around it by setting HideSoftInputOnTapped false before navigating back
  • It's a fairly light change that touches a very isolated area of the code

Issues Fixed

Fixes #17681

@jfversluis jfversluis merged commit 71eb837 into main Oct 2, 2023
47 checks passed
@jfversluis jfversluis deleted the fix_17681 branch October 2, 2023 10:49
@PureWeen
Copy link
Member Author

PureWeen commented Oct 3, 2023

/backport to release/8.0.1xx-rc2

@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2023

Started backporting to release/8.0.1xx-rc2: https://github.com/dotnet/maui/actions/runs/6394127933

@github-actions github-actions bot locked and limited conversation to collaborators Dec 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NRE in HideSoftInputOnTappedChangedManager.UpdateFocusForView
3 participants