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

Crash when exiting "Open File"/"Choose File" dialog pressing the key Esc. #1352

Closed
woxip0 opened this issue Jun 3, 2021 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@woxip0
Copy link

woxip0 commented Jun 3, 2021

Description

Message: "Cannot change the RoutedEvent property while the RoutedEvent is being routed."

Using webview2 last version embedded in a WPF application, whenever I press Esc and sometimes pressing the button Cancel in a "Select File"/"Choose File" dialog the application crash with the following callstack:
StackTrace " at System.Windows.RoutedEventArgs.set_RoutedEvent(RoutedEvent value) at Microsoft.Web.WebView2.Wpf.WebView2.OnPreviewKeyUp(KeyEventArgs e) at System.Windows.UIElement.OnPreviewKeyUpThunk(Object sender, KeyEventArgs e) at System.Windows.Input.KeyEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args) at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted) at System.Windows.Input.InputManager.ProcessStagingArea() at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input) at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport) at System.Windows.Interop.HwndKeyboardInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawKeyboardActions actions, Int32 scanCode, Boolean isExtendedKey, Boolean isSystemKey, Int32 virtualKey) at System.Windows.Interop.HwndKeyboardInputProvider.ProcessKeyAction(MSG& msg, Boolean& handled) at System.Windows.Interop.HwndSource.CriticalTranslateAccelerator(MSG& msg, ModifierKeys modifiers) at System.Windows.Interop.HwndSource.OnPreprocessMessage(Object param) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg) at System.Windows.Interop.HwndSource.OnPreprocessMessageThunk(MSG& msg, Boolean& handled) at System.Windows.Interop.HwndSource.WeakEventPreprocessMessage.OnPreprocessMessage(MSG& msg, Boolean& handled) at System.Windows.Interop.ThreadMessageEventHandler.Invoke(MSG& msg, Boolean& handled) at System.Windows.Interop.ComponentDispatcherThread.RaiseThreadMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) at System.Windows.Application.RunDispatcher(Object ignore) at System.Windows.Application.RunInternal(Window window) at System.Windows.Application.Run(Window window) at System.Windows.Application.Run() at MyApp.App.Main()" string
Version
SDK: 1.0.864.35
Runtime: 91.0.864.37 x64
Framework: WPF
OS: Windows10 19042.985
.Net Framework 4.8

Repro Steps

  1. Click on input type=file to pick/open a file
  2. Exit pressing the key Esc. Sometimes just pressing the button Cancel gives the same error.

Additional context
I disabled all the events in my code and, still I get the same error. It is a bare embedding of WebView2. Also, I cleaned the solution and tried to run again, getting it always.

@woxip0 woxip0 added the bug Something isn't working label Jun 3, 2021
@woxip0
Copy link
Author

woxip0 commented Jun 3, 2021

Tested against this simple html:

<html>
	<body>
		<input type="file" />
	</body>
</html>

@champnic
Copy link
Member

champnic commented Jun 4, 2021

Thanks for the bug report @woxip0 - this looks to be the same issue as #1099, which we should have a fix for shortly. Thanks!

@champnic champnic closed this as completed Jun 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants