Skip to content

Commit

Permalink
[show-hint addon] Fix race condition in scroll measurement
Browse files Browse the repository at this point in the history
Issue #6656
Issue #6467
  • Loading branch information
marijnh committed Apr 14, 2021
1 parent f3033a2 commit 86af2dc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions addon/hint/show-hint.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@

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

0 comments on commit 86af2dc

Please sign in to comment.