diff --git a/src/main/webapp/app/shared/monaco-editor/monaco-editor.component.scss b/src/main/webapp/app/shared/monaco-editor/monaco-editor.component.scss index 6886fcfcc0dc..2a7688469e76 100644 --- a/src/main/webapp/app/shared/monaco-editor/monaco-editor.component.scss +++ b/src/main/webapp/app/shared/monaco-editor/monaco-editor.component.scss @@ -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; + } } } diff --git a/src/main/webapp/app/shared/monaco-editor/monaco-editor.component.ts b/src/main/webapp/app/shared/monaco-editor/monaco-editor.component.ts index b9138398fcee..eb6fb1dfc831 100644 --- a/src/main/webapp/app/shared/monaco-editor/monaco-editor.component.ts +++ b/src/main/webapp/app/shared/monaco-editor/monaco-editor.component.ts @@ -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(); }); }