Skip to content

Commit

Permalink
fix: focusing searchbox in new tab
Browse files Browse the repository at this point in the history
  • Loading branch information
sentialx committed Oct 1, 2019
1 parent 0358e8e commit 80705b1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
12 changes: 7 additions & 5 deletions src/main/dialogs/dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@ export class Dialog extends BrowserView {
clearTimeout(this.timeout);

this.rearrange();

this.appWindow.removeBrowserView(this);
this.appWindow.addBrowserView(this);
this.bringToTop();

if (focus) this.webContents.focus();
}
Expand All @@ -108,8 +106,7 @@ export class Dialog extends BrowserView {
}

public hide() {
this.appWindow.removeBrowserView(this);
this.appWindow.addBrowserView(this);
this.bringToTop();

clearTimeout(this.timeout);

Expand All @@ -121,4 +118,9 @@ export class Dialog extends BrowserView {

this.visible = false;
}

public bringToTop() {
this.appWindow.removeBrowserView(this);
this.appWindow.addBrowserView(this);
}
}
5 changes: 1 addition & 4 deletions src/main/view-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,7 @@ export class ViewManager {

this.window.menuDialog.hide();
this.window.findDialog.hide();

if (!view.webContents.getURL().startsWith(NEWTAB_URL)) {
this.window.searchDialog.hide();
}
this.window.searchDialog.bringToTop();

this.fixBounds();
}
Expand Down

0 comments on commit 80705b1

Please sign in to comment.