Focus the surface in the reference dialog after it opens

Otherwise the surface ends up in a weird half-focused state which
causes it to behave strangely.

Bug: 63909
Change-Id: I3ebc30fde0202116b383a5b497aca65b66732922
This commit is contained in:
Roan Kattouw 2014-04-14 16:27:27 -07:00 committed by Jforrester
parent 42f9d3e45b
commit b764ecc7f4

View file

@ -23,6 +23,9 @@ ve.ui.MWReferenceDialog = function VeUiMWReferenceDialog( config ) {
// Properties
this.referenceModel = null;
// Events
this.connect( this, { 'open': 'onOpen' } );
};
/* Inheritance */
@ -319,6 +322,14 @@ ve.ui.MWReferenceDialog.prototype.setup = function ( data ) {
this.selectButton.setDisabled( this.search.isIndexEmpty() );
};
/**
* Respond to 'open' event. Fires once the dialog has finished opening.
*/
ve.ui.MWReferenceDialog.prototype.onOpen = function () {
// Focus the reference surface
this.referenceSurface.focus();
};
/**
* @inheritdoc
*/