|mediawiki/extensions/VisualEditor : master||Hack to not show menu immediately upon meta dialog opening for redirect change|
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.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?