Page MenuHomePhabricator

On auto-focusing the redirect entry box when editing a redirect, don't suggest replacements unless the user does something
Closed, ResolvedPublic1 Story Points

Details

Related Gerrit Patches:

Event Timeline

Restricted Application added subscribers: Zppix, Aklapper. · View Herald TranscriptJun 8 2016, 2:13 PM
AlexMonk-WMF added a subscriber: AlexMonk-WMF.

I came up with a setTimeout hack for this today.

I came up with a setTimeout hack for this today.

Patch in-bound? :-)

For some reason I thought I had uploaded already.

(Note: To reproduce this your redirect must be to a page that exists or returns search results, and must already have focused something like the VE surface)

What seems to be going on here is mw.widgets.TitleInputWidget.prototype.focus disabling lookups in LookupElement, then having InputWidget (via TextInputWidget) call this.$input[0].focus(), and reenabling lookups.
Except the actual focus (and hence the event being sent causing OO.ui.mixin.LookupElement.prototype.onLookupInputFocus/populateLookupMenu to be called) appears to happen not during the HTMLInputElement#focus call but after it, when lookups have been reenabled. Probably due to the dialog not having opened yet.

So sticking MWSettingsDialog's focus call inside a setTimeout works by deferring it until after the dialog has opened?

Change 294359 had a related patch set uploaded (by Alex Monk):
Hack to not show menu immediately upon meta dialog opening for redirect change

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

Change 294359 merged by jenkins-bot:
Hack to not show menu immediately upon meta dialog opening for redirect change

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

AlexMonk-WMF closed this task as Resolved.Jun 30 2016, 9:52 PM