mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
🐛 Fix a regression from the previous commit and a comment
This commit is contained in:
parent
e5c076e82f
commit
f8d5dcd060
1 changed files with 7 additions and 3 deletions
10
lib/hterm.js
10
lib/hterm.js
|
|
@ -394,10 +394,14 @@ hterm.Screen.prototype.syncSelectionCaret = function () {
|
|||
s.addRange(r);
|
||||
};
|
||||
|
||||
const oldScrollPortFocus = hterm.ScrollPort.prototype.focus;
|
||||
// For some reason, when the original version of this function was called right
|
||||
// after a new tab was created, it was breaking the focus of the other tab.
|
||||
// After some investigation, I (matheuss) found that `this.iframe_.focus();` (from
|
||||
// the original function) was causing the issue. So right now we're overriding
|
||||
// the function to prevent the `iframe_` from being focused.
|
||||
// This shouldn't create any side effects – we're _stealing_ the focus from `htem` anyways.
|
||||
hterm.ScrollPort.prototype.focus = function () {
|
||||
oldScrollPortFocus();
|
||||
this.terminal.focusHyperCaret();
|
||||
this.screen_.focus();
|
||||
};
|
||||
|
||||
// fixes a bug in hterm, where the cursor goes back to `BLOCK`
|
||||
|
|
|
|||
Loading…
Reference in a new issue