-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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 'e.getModifierState is not a function' error for browser auto filled form events #206883
Conversation
Any chance of a swift merge? The diff is trivial and this issue really affects Monaco users heavily. @BusinessDuck can you change the PR title to something descriptive? It might be one reason why the PR was ignored so far. |
Is that looks better now? |
Yes, thanks. The fix is good enough to get the error away. The error also highlights a deeper underlying problem: VSCode should not be "listening in" on events that are targeting elements which are outside of its root element. Essentially, it's being a "bad neighbor" currently. |
Thank you! |
Some browser events may not contains
getMidifierState
method. For example events, that produced by forms auto-fills.Check the demo stand in associated issue #205214
Optional chaining for that method should solve the problem.
Test cases:
new Event()
programmatically and dispatch, that will produce error also because correct way to usenew KeyboardEvent()