Page MenuHomePhabricator

jquery.ui.ooMenu.js should not cause warning "jQuery.fn.offset() requires an element connected to a document"
Open, Needs TriagePublic

Description

The script at

(or https://www.wikidata.org/w/extensions/Wikibase/view/lib/wikibase-data-values-value-view/lib/jquery.ui/jquery.ui.ooMenu.js?31222 )
has the line

if ( this.element.offset().left + this.element.outerWidth( true ) > $( window ).width() ) {

which causes the warning

JQMIGRATE: jQuery.fn.offset() requires an element connected to a document

in the console when visiting
https://www.wikidata.org/wiki/Special:Watchlist?debug=1

Event Timeline

He7d3r created this task.Jan 24 2018, 10:01 AM
Restricted Application added a project: Wikidata. · View Herald TranscriptJan 24 2018, 10:01 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Seb35 added a subscriber: Seb35.May 14 2019, 9:04 PM

Instead of solving this task, it would be better (but harder) to rewrite the current ooMenu without using jQuery.ui.widget but OOUI, given this component got deprecated by T142418. But if I understand correctly the dependencies between components, in addition of the suggester of the search box in non-item pages, most suggesters in items edition use ooMenu, which makes the task even harder.