Page MenuHomePhabricator

ClippableElement not compatible with jQuery 3.0
Closed, ResolvedPublic

Description

Popup menus etc. fail in conjunction with jQuery 3. Using jquery-migrate, the following message is obtained:

JQMIGRATE: jQuery.fn.offset() requires a valid DOM element

The trace leads to OO.ui.mixin.ClippableElement.clip:

$scrollableContainer = this.$clippableScrollableContainer.is( 'html, body' ) ? this.$clippableWindow : this.$clippableScrollableContainer;
scOffset = $scrollableContainer.offset() || { top: 0, left: 0 };

(oojs-ui-core.js line 4108)

Event Timeline

matmarex subscribed.

The simplified problem is that $( window ).offset() returns undefined in jQuery 1, and throws an exception in jQuery 3. We can easily change the code to avoid relying on this.

Change 326129 had a related patch set uploaded (by Bartosz Dziewoński):
ClippableElement: Compatibility with jQuery 3

https://gerrit.wikimedia.org/r/326129

Jdforrester-WMF moved this task from Backlog to Doing on the OOUI board.

Change 326129 merged by jenkins-bot:
ClippableElement: Compatibility with jQuery 3

https://gerrit.wikimedia.org/r/326129

Volker_E edited projects, added OOUI (OOjs-UI-0.18.2); removed OOUI.