Skip to content

Commit 86af2dc

Browse files
committed
[show-hint addon] Fix race condition in scroll measurement
Issue #6656 Issue #6467
1 parent f3033a2 commit 86af2dc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

addon/hint/show-hint.js

+1
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@
322322

323323
cm.on("scroll", this.onScroll = function() {
324324
var curScroll = cm.getScrollInfo(), editor = cm.getWrapperElement().getBoundingClientRect();
325+
if (!startScroll) startScroll = cm.getScrollInfo();
325326
var newTop = top + startScroll.top - curScroll.top;
326327
var point = newTop - (parentWindow.pageYOffset || (ownerDocument.documentElement || ownerDocument.body).scrollTop);
327328
if (!below) point += hints.offsetHeight;

0 commit comments

Comments
 (0)