CommunityToolkit / Maui

The .NET MAUI Community Toolkit is a community-created library that contains .NET MAUI Extensions, Advanced UI/UX Controls, and Behaviors to help make your life as a .NET MAUI developer easier
https://learn.microsoft.com/dotnet/communitytoolkit/maui
MIT License
2.09k stars 337 forks source link

[BUG] Application crashes when pressing Tab+Spacebar while video is playing using CommunityToolkit.Maui.MediaElement on Windows platform #1863

Open SanthoshAthili3101 opened 3 weeks ago

SanthoshAthili3101 commented 3 weeks ago

Is there an existing issue for this?

Did you read the "Reporting a bug" section on Contributing file?

Current Behavior

The application crashes immediately upon pressing the "Tab" key and the "Spacebar" key simultaneously while the video is playing. The crash occurs consistently, and no error message or exception is displayed to the user.

Expected Behavior

The application should handle the key press combination without crashing, and the video playback should continue uninterrupted.

Steps To Reproduce

  1. Launch the .NET MAUI application on a Windows platform.
  2. Navigate to the screen where a video is displayed using the MediaElement control.
  3. Start playing the video.
  4. While the video is playing, press the "Tab" key and the "Spacebar" key simultaneously.

Link to public reproduction project repository

NA

Environment

- .NET MAUI CommunityToolkit:2.0.0
- OS: Windows
- .NET MAUI:7

Anything else?

No response

dotnet-policy-service[bot] commented 3 weeks ago

Hi @SanthoshAthili3101. We have added the "needs reproduction" label to this issue, which indicates that we cannot take further action. This issue will be closed automatically in 5 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

olekssokol commented 3 weeks ago

Hi @SanthoshAthili3101, I have managed to reproduce this in the CommunityToolkit.Maui.Sample project. In my case, this happens only when the "Tab" key switches the active state to the "Change Aspect" button, and then the "Space" key executes it. In this case, the problem is due to the DisplayActionSheet call from the Microsoft.Maui.Controls package, it should display the window and return the pressed button, but instead of the window, it immediately returns null, which was not handled in the Sample project. I fixed it at the project level in my branch (1863-bug-application-crashes), but this is an issue in Maui.Controls of older versions and in 8.0.21 everything works without crash.

If you are experiencing the issue in a different way, please provide details so I can help you.