mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-05 20:08:58 -05:00
Fix monaco-editor#643. Firefox loses focus on iframe.
This commit is contained in:
@@ -558,6 +558,10 @@ class TextAreaWrapper extends Disposable implements ITextAreaWrapper {
|
||||
|
||||
if (currentIsFocused && currentSelectionStart === selectionStart && currentSelectionEnd === selectionEnd) {
|
||||
// No change
|
||||
// Firefox iframe bug https://github.com/Microsoft/monaco-editor/issues/643#issuecomment-367871377
|
||||
if (browser.isFirefox && window.parent !== window) {
|
||||
textArea.focus();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -567,6 +571,9 @@ class TextAreaWrapper extends Disposable implements ITextAreaWrapper {
|
||||
// No need to focus, only need to change the selection range
|
||||
this.setIgnoreSelectionChangeTime('setSelectionRange');
|
||||
textArea.setSelectionRange(selectionStart, selectionEnd);
|
||||
if (browser.isFirefox && window.parent !== window) {
|
||||
textArea.focus();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user