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 Sentry interfering with MAUI's focus events #1891

Merged
merged 6 commits into from
Sep 1, 2022

Conversation

mattjohnsonpint
Copy link
Contributor

Fixes #1886

We were binding to Microsoft.Maui.Controls.VisualElement.FocusChangeRequested via reflection. That particular event has a handler that requires setting e.Result = true in order to not block the focus request. Unfortunately, the default is false (ouch!).

FocusChangeRequested is marked with [EditorBrowsable(EditorBrowsableState.Never)], indicating it's not meant for public consumption. We probably shouldn't have been attaching to it at all.

Fixed this in two ways:

  • Changed the reflection-based event handler to not hook any events marked with EditorBrowsable (unless its param is Always)
  • Added non-reflection-based event handlers for VisualElement so we can better control the specific events from that type.

@mattjohnsonpint mattjohnsonpint enabled auto-merge (squash) September 1, 2022 15:58
@mattjohnsonpint mattjohnsonpint merged commit 3b01f68 into main Sep 1, 2022
@mattjohnsonpint mattjohnsonpint deleted the fix-maui-events branch September 1, 2022 16:00
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.

Focus Event stops working when Sentry.Maui is installed
2 participants