Skip to content

Commit

Permalink
General: Hide the keyboard icon from the Monaco editor on Apple devic…
Browse files Browse the repository at this point in the history
…es (#9519)
  • Loading branch information
pzdr7 authored Oct 24, 2024
1 parent 4c34fe6 commit 61c92c6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
.monaco-editor {
// Disables the focus border around the editor.
outline: none;

// Apple devices display a keyboard icon in the bottom right corner of the editor. We disable this as it does not fit our design.
.iPadShowKeyboard {
display: none;
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ export class MonacoEditorComponent implements OnInit, OnDestroy {
});

this.blurEditorWidgetListener = this._editor.onDidBlurEditorWidget(() => {
// On iOS, the editor does not lose focus when clicking outside of it. This listener ensures that the editor loses focus when the editor widget loses focus.
// See https://github.com/microsoft/monaco-editor/issues/307
if (document.activeElement && 'blur' in document.activeElement && typeof document.activeElement.blur === 'function') {
document.activeElement.blur();
}
this.onBlurEditor.emit();
});
}
Expand Down

0 comments on commit 61c92c6

Please sign in to comment.