Make readonly work for OOUI forms
authorGlaisher <glaisher.wiki@gmail.com>
Tue, 1 Sep 2015 12:37:54 +0000 (17:37 +0500)
committerGlaisher <glaisher.wiki@gmail.com>
Tue, 1 Sep 2015 12:37:54 +0000 (17:37 +0500)
This seems like a hack. Copied from HTMLTextField.

Change-Id: I46f3dbd4b60fd9a39ecd7167ec903ae7d1d804bc

includes/htmlform/HTMLTextAreaField.php

index aeb4b7c..5cfea63 100644 (file)
@@ -71,6 +71,11 @@ class HTMLTextAreaField extends HTMLFormField {
                        'readonly' => 'readOnly',
                ) );
 
+               if ( isset( $attribs['readOnly'] ) ) {
+                       // this needs to be set to a boolean value - hack??
+                       $attribs['readOnly'] = true;
+               }
+
                return new OOUI\TextInputWidget( array(
                        'id' => $this->mID,
                        'name' => $this->mName,