VolkerE has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/404144 )

Change subject: Clarify `required` true handling with `indicator: 'required'`
......................................................................

Clarify `required` true handling with `indicator: 'required'`

Also change demo to use a different indicator.

Bug: T184811
Change-Id: I1651a257760a769b122baa1cc84d686c72e952e8
---
M demos/pages/widgets.php
M php/widgets/MultilineTextInputWidget.php
M php/widgets/TextInputWidget.php
M src/widgets/TextInputWidget.js
4 files changed, 7 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/44/404144/1

diff --git a/demos/pages/widgets.php b/demos/pages/widgets.php
index 9932470..9f1c971 100644
--- a/demos/pages/widgets.php
+++ b/demos/pages/widgets.php
@@ -430,7 +430,7 @@
                        new OOUI\MultilineTextInputWidget( [
                                'value' => "Multiline\nMultiline",
                                'icon' => 'tag',
-                               'indicator' => 'required'
+                               'indicator' => 'alert'
                        ] ),
                        [
                                'label' => "MultilineTextInputWidget (icon, 
indicator)\xE2\x80\x8E",
diff --git a/php/widgets/MultilineTextInputWidget.php 
b/php/widgets/MultilineTextInputWidget.php
index 73d3975..1ccf7d9 100644
--- a/php/widgets/MultilineTextInputWidget.php
+++ b/php/widgets/MultilineTextInputWidget.php
@@ -23,7 +23,8 @@
         * @param number $config['maxLength'] Maximum allowed number of 
characters to input
         * @param int $config['rows'] If multiline, number of visible lines in 
textarea
         * @param bool $config['required'] Mark the field as required.
-        *   Implies `indicator: 'required'`. (default: false)
+        *   Implies `indicator: 'required'`. Note that `false` & setting 
`indicator: 'required'
+        *   will result in no indicator shown. (default: false)
         */
        public function __construct( array $config = [] ) {
                // Config initialization
diff --git a/php/widgets/TextInputWidget.php b/php/widgets/TextInputWidget.php
index a576f6a..f879c6a 100644
--- a/php/widgets/TextInputWidget.php
+++ b/php/widgets/TextInputWidget.php
@@ -51,7 +51,8 @@
         * @param bool $config['multiline'] Allow multiple lines of text 
(default: false)
         * @param int $config['rows'] If multiline, number of visible lines in 
textarea
         * @param bool $config['required'] Mark the field as required.
-        *   Implies `indicator: 'required'`. (default: false)
+        *   Implies `indicator: 'required'`. Note that `false` & setting 
`indicator: 'required'
+        *   will result in no indicator shown. (default: false)
         * @param bool $config['autocomplete'] If the field should support 
autocomplete
         *   or not (default: true)
         * @param bool $config['spellcheck'] If the field should support 
spellcheck
diff --git a/src/widgets/TextInputWidget.js b/src/widgets/TextInputWidget.js
index 0032013..45908d1 100644
--- a/src/widgets/TextInputWidget.js
+++ b/src/widgets/TextInputWidget.js
@@ -35,7 +35,8 @@
  * @cfg {number} [maxLength] Maximum number of characters allowed in the input.
  * @cfg {string} [labelPosition='after'] The position of the inline label 
relative to that of
  *  the value or placeholder text: `'before'` or `'after'`
- * @cfg {boolean} [required=false] Mark the field as required. Implies 
`indicator: 'required'`.
+ * @cfg {boolean} [required=false] Mark the field as required with `true`. 
Implies `indicator: 'required'`.
+ *  Note that `false` & setting `indicator: 'required' will result in no 
indicator shown.
  * @cfg {boolean} [autocomplete=true] Should the browser support autocomplete 
for this field
  * @cfg {boolean} [spellcheck] Should the browser support spellcheck for this 
field (`undefined` means
  *  leaving it up to the browser).

-- 
To view, visit https://gerrit.wikimedia.org/r/404144
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1651a257760a769b122baa1cc84d686c72e952e8
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: VolkerE <volke...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to