mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-23 15:16:50 +00:00
Account for scroll offset when using non-mouse positioning
offsetTop includes the scroll offset, so when using it to calculate clientTop (position relative to the viewport), we need to substract that offset. clientY comes from mouse events and is already relative to the viewport so needs no adjustment. Bug: T270215 Change-Id: I545b14059f416678fc0d35413a76334e57bfc495
This commit is contained in:
parent
b46fc85941
commit
d4b0d10b13
BIN
resources/dist/index.js
vendored
BIN
resources/dist/index.js
vendored
Binary file not shown.
BIN
resources/dist/index.js.map.json
vendored
BIN
resources/dist/index.js.map.json
vendored
Binary file not shown.
|
@ -381,7 +381,7 @@ export function createLayout(
|
|||
// Position according to link position or size
|
||||
measures.offset.top + measures.height + pointerSize,
|
||||
offsetLeft;
|
||||
const clientTop = measures.clientY ? measures.clientY : offsetTop;
|
||||
const clientTop = measures.clientY ? measures.clientY : offsetTop - measures.scrollTop;
|
||||
|
||||
if ( measures.pageX ) {
|
||||
if ( measures.width > maxLinkWidthForCenteredPointer ) {
|
||||
|
|
Loading…
Reference in a new issue