mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-15 02:54:07 +00:00
editor: finish remove hack TODO
The upstream fix was merged, so the workaround is no longer needed.
This commit is contained in:
committed by
David Lechner
parent
764083e6be
commit
db438be40b
@@ -429,25 +429,6 @@ const Editor: React.VFC = () => {
|
||||
[],
|
||||
);
|
||||
|
||||
useEditor(
|
||||
editor,
|
||||
(editor) => {
|
||||
// TODO: can be removed when https://github.com/microsoft/vscode/pull/146968 is merged
|
||||
// HACK: The editor eats context menu key press events event when
|
||||
// the monaco context menu is disabled so we have to fake it
|
||||
const subscription = editor.onKeyDown((e) => {
|
||||
if (e.keyCode === monaco.KeyCode.ContextMenu) {
|
||||
e.target.dispatchEvent(
|
||||
new MouseEvent('contextmenu', { bubbles: true }),
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
return () => subscription.dispose();
|
||||
},
|
||||
[],
|
||||
);
|
||||
|
||||
const handleEditorDidMount = useCallback<EditorDidMount>(
|
||||
(editor) => {
|
||||
editor.focus();
|
||||
|
||||
Reference in New Issue
Block a user