Skip to content
This repository was archived by the owner on Dec 11, 2019. It is now read-only.

Commit 1154bb3

Browse files
committed
Improve tab preview timing
- Fix #8860 - Auditors: @bsclifton, @bradleyrichter
1 parent 6ec02d8 commit 1154bb3

File tree

1 file changed

+9
-8
lines changed
  • app/renderer/components/tabs

1 file changed

+9
-8
lines changed

app/renderer/components/tabs/tab.js

+9-8
Original file line numberDiff line numberDiff line change
@@ -172,16 +172,17 @@ class Tab extends ImmutableComponent {
172172
}
173173

174174
onMouseEnter (e) {
175-
// relatedTarget inside mouseenter checks which element before this event was the pointer on
176-
// if this element has a tab-like class, then it's likely that the user was previewing
177-
// a sequency of tabs. Called here as previewMode.
178-
const previewMode = /tab(?!pages)/i.test(e.relatedTarget.classList)
175+
// Includes all classes that the mouse can came from
176+
// if user is going from urlbar to webview or vice-versa
177+
const fromVerticalAxis =
178+
/^tab(?=stoolbar|pages)|^allowdragging|^singlepage|^bookmarks|^webview/i
179+
.test(e.relatedTarget.classList)
179180

180-
// If user isn't in previewMode, we add a bit of delay to avoid tab from flashing out
181-
// as reported here: https://github.com/brave/browser-laptop/issues/1434
182181
if (this.props.previewTabs) {
183-
this.hoverTimeout =
184-
window.setTimeout(windowActions.setPreviewFrame.bind(null, this.props.frame.get('key')), previewMode ? 0 : 200)
182+
this.hoverTimeout = window.setTimeout(
183+
windowActions.setPreviewFrame.bind(null, this.props.frame.get('key')),
184+
fromVerticalAxis ? 350 : 0
185+
)
185186
}
186187
windowActions.setTabHoverState(this.props.frame.get('key'), true)
187188
}

0 commit comments

Comments
 (0)