Skip to content

Commit 9f15f70

Browse files
committed
fix
1 parent 283dc2f commit 9f15f70

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

src/components/YamlEditor/YamlEditor.tsx

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -103,27 +103,6 @@ export const YamlEditor = (props: YamlEditorProps) => {
103103
[isEdit, onChange],
104104
);
105105

106-
// Stop key events from bubbling to parent components (e.g., UI5 toolbars) which may intercept Space
107-
const handleEditorMount = useCallback(
108-
(editorInstance: monaco.editor.IStandaloneCodeEditor, monacoApi: typeof monaco) => {
109-
const stopIfSpace = (ev: monaco.IKeyboardEvent) => {
110-
const be = ev.browserEvent as KeyboardEvent;
111-
const isSpace = be.code === 'Space' || be.key === ' ' || be.key === 'Spacebar';
112-
if (isSpace) be.stopPropagation();
113-
};
114-
115-
editorInstance.onKeyDown(stopIfSpace);
116-
editorInstance.onKeyUp(stopIfSpace);
117-
118-
// Call parent onMount with strong types, avoid any casts
119-
const typedParentOnMount = parentOnMount as
120-
| ((editor: monaco.editor.IStandaloneCodeEditor, monacoNs: typeof monaco) => void)
121-
| undefined;
122-
typedParentOnMount?.(editorInstance, monacoApi);
123-
},
124-
[parentOnMount],
125-
);
126-
127106
const handleApply = useCallback(() => {
128107
const run = async () => {
129108
setApplyAttempted(true);
@@ -174,7 +153,6 @@ export const YamlEditor = (props: YamlEditorProps) => {
174153
height="100%"
175154
language="yaml"
176155
onChange={handleEditorChange}
177-
onMount={handleEditorMount}
178156
/>
179157
</div>
180158
{showValidationErrors && (

0 commit comments

Comments
 (0)