Page MenuHomePhabricator

Trying to scroll invisible elements into view is slow
Closed, ResolvedPublic

Description

Trying to scroll invisible elements into view is slow. It would be faster not to try to scroll them. ;)

In UploadWizard, for every upload, we create (among a lot of other things) a DropdownWidget of languages and call .getMenu().selectItemByData( … ) (see code in uw.DescriptionDetailsWidget). This causes SelectWidget/OptionWidget to attempt to scroll the newly selected option into view. However, unless the dropdown is open (which it can't be at this point), this does nothing at all, and takes around ~10 ms. When we have 50 uploads, that adds up to half a second of unnecessary delay.

Event Timeline

matmarex created this task.Dec 16 2016, 5:08 PM

Change 327769 had a related patch set uploaded (by Bartosz Dziewoński):
Element: Do not try to scroll invisible elements into view

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

Jdforrester-WMF closed this task as Resolved.Dec 17 2016, 2:42 AM
Jdforrester-WMF moved this task from Backlog to OOjs-UI-0.18.3 on the OOUI board.
Jdforrester-WMF edited projects, added OOUI (OOjs-UI-0.18.3); removed OOUI.
Jdforrester-WMF edited projects, added Performance; removed Patch-For-Review.

Change 327769 merged by jenkins-bot:
Element: Do not try to scroll invisible/unattached elements into view

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