Fix 'e.getModifierState is not a function' error for browser auto filled form events#206883
Merged
alexdima merged 4 commits intomicrosoft:mainfrom Mar 14, 2024
Merged
Fix 'e.getModifierState is not a function' error for browser auto filled form events#206883alexdima merged 4 commits intomicrosoft:mainfrom
alexdima merged 4 commits intomicrosoft:mainfrom
Conversation
2 tasks
silverwind
approved these changes
Mar 8, 2024
yardenshoham
approved these changes
Mar 9, 2024
|
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. |
Contributor
Author
|
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. |
alexdima
approved these changes
Mar 14, 2024
Member
|
Thank you! |
sandy081
approved these changes
Mar 14, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some browser events may not contains
getMidifierStatemethod. 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()