jenkins-bot has submitted this change and it was merged.

Change subject: ClippableElement: Fix behavior of clippables in nested 
scrollables
......................................................................


ClippableElement: Fix behavior of clippables in nested scrollables

Apparently 'cOffset' already includes the 'scrollTop' when the
scrollable container is not the window, which is kind of reasonable in
a sick way, since it's supposed to be position relative to document,
and that position changes when the scrollable parent is scrolled.

The issue wasn't affecting VisualEditor because our nested scrollables
(dialogs) are always using fixed positioning and thus their position
doesn't change.

Bug: T98506
Change-Id: I756d1eafa8b9e0fdfa34906f76bac5998ebc6abc
---
M src/elements/ClippableElement.js
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Anomie: Looks good to me, but someone else must approve
  Trevor Parscal: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/src/elements/ClippableElement.js b/src/elements/ClippableElement.js
index 8c9f2e1..10d4191 100644
--- a/src/elements/ClippableElement.js
+++ b/src/elements/ClippableElement.js
@@ -168,7 +168,7 @@
                ccHeight = $container.innerHeight() - buffer,
                ccWidth = $container.innerWidth() - buffer,
                cWidth = this.$clippable.outerWidth() + buffer,
-               scrollTop = this.$clippableScroller.scrollTop(),
+               scrollTop = this.$clippableScroller[0] === 
this.$clippableWindow[0] ? this.$clippableScroller.scrollTop() : 0,
                scrollLeft = this.$clippableScroller.scrollLeft(),
                desiredWidth = cOffset.left < 0 ?
                        cWidth + cOffset.left :

-- 
To view, visit https://gerrit.wikimedia.org/r/213285
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I756d1eafa8b9e0fdfa34906f76bac5998ebc6abc
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Bartosz DziewoƄski <matma....@gmail.com>
Gerrit-Reviewer: Anomie <bjor...@wikimedia.org>
Gerrit-Reviewer: Esanders <esand...@wikimedia.org>
Gerrit-Reviewer: Trevor Parscal <tpars...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to