monaco-editor icon indicating copy to clipboard operation
monaco-editor copied to clipboard

[Bug] Uncaught TypeError: e.getModifierState is not a function when using AutoFill in Chrome or Edge

Open justin-mellor opened this issue 1 year ago • 3 comments
trafficstars

Reproducible in vscode.dev or in VS Code Desktop?

  • [X] Not reproducible in vscode.dev or VS Code Desktop

Reproducible in the monaco editor playground?

Monaco Editor Playground Link

https://microsoft.github.io/monaco-editor/playground.html?source=v0.45.0#XQAAAALPAQAAAAAAAABBqQkHQ5NjdWX_QlY8elt1pNs_6w0JpADsxkIibQ4UF1H1DOiVjoiCcXryotF3-FScMrdUTFY2N9rYW7Rvn8toGAduu845WKA_3gtIsou2w81P-Nn1qpd1PJbYFe457jNKMRsobVqDRNkd5gMoxJoz7UwsJx8lmnhOk9tyuUtMpWa5IdrO74lmGLe2Vp7a7q1pG8XNQz4_jhk_70sjpNwkiiLhJuyFxGCRQ6QPhHckAjHy2l7jWkpKOKZbiml25iQU5paF87C-3t-tBbk_QHJmbrw7Cnlq8vs_LCWrOnLtgzLOnshAZbkd8Eldg8n7gNXPGttEhyxcTilGPuctsyea3jMyaCxeHhFDBURIaREWTxyJ6-QtSrcSufWfkK-VI8hFfXTLm9xGSs6r3RLrm6ZZ3_CpAmtLqp2-FZk3_uM-oWTYuLxeI6T_kXvpI55SKy7BS_42ZyJ-72YRLblgoUJMD1n_77MOAQ

Monaco Editor Playground Code

No response

Reproduction Steps

Using Chrome or Edge Enter some text in the text box "Use AutoFill to populate this textbox" Click Reload to populate your auto fill buffer in the browser Now click inside the text box "Use AutoFill to populate this textbox" Choose your text from the "Saved data" dropdown

Actual (Problematic) Behavior

In the console an error is thrown

Uncaught TypeError: e.getModifierState is not a function
    at new StandardKeyboardEvent (keyboardEvent.ts:111:24)
    at HTMLBodyElement.<anonymous> (dom.ts:178:18)

Expected Behavior

No error should be thrown

Additional Context

No response

justin-mellor avatar Jan 05 '24 16:01 justin-mellor

+11111111111111111111

Ryuurock avatar Jan 17 '24 09:01 Ryuurock

+1

DanielYuan123 avatar Jan 29 '24 09:01 DanielYuan123

Getting the error as well after the monaco editor was initialized across the whole app on any input field (not the editor). Error appears in the constructor of StandardKeyboardEvent class as Event is not a KeyboardEvent and doesn't have that method: image image

But it seems to be a wider issue as to why would you handle events on input fields which is not the Monaco editor?

mivanyna avatar Feb 13 '24 16:02 mivanyna

https://github.com/microsoft/vscode/pull/206883 fix is on the way

BusinessDuck avatar Mar 05 '24 12:03 BusinessDuck

I see that this is fixed by that PR being merged in. What Monaco version do we need to update to, to consume this fix?

landonmsft avatar Apr 15 '24 17:04 landonmsft

@hediet If monaco-editor 0.48.0 absorbs vscode package version 1.88.0, this issue should be resolved now :)

landonmsft avatar Apr 23 '24 18:04 landonmsft

Seems 0.48.0 has fixed it indeed.

silverwind avatar Apr 26 '24 08:04 silverwind