From 03fbed5176b056d02a7165415090f79069805e2b Mon Sep 17 00:00:00 2001 From: Florian Date: Thu, 29 Oct 2015 19:00:59 +0100 Subject: [PATCH] HTMLUserTextField: Enable suggestions for non-OOUI mode Bug: T117067 Change-Id: I03eabf6ed5d5a36534a5eec76c05d0a353ebf6ff --- includes/htmlform/HTMLUserTextField.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/includes/htmlform/HTMLUserTextField.php b/includes/htmlform/HTMLUserTextField.php index 9617c0a35a..8816d37fe8 100644 --- a/includes/htmlform/HTMLUserTextField.php +++ b/includes/htmlform/HTMLUserTextField.php @@ -44,4 +44,13 @@ class HTMLUserTextField extends HTMLTextField { return new UserInputWidget( $params ); } + + public function getInputHtml( $value ) { + // add the required module and css class for user suggestions in non-OOUI mode + $this->mParent->getOutput()->addModules( 'mediawiki.userSuggest' ); + $this->mClass .= ' mw-autocomplete-user'; + + // return parent html + return parent::getInputHtml( $value ); + } } -- 2.20.1