HTMLFormFieldWithButton: Allow passing 'inputtype' and pass through 'buttonid'
authorEd Sanders <esanders@wikimedia.org>
Thu, 11 Apr 2019 16:39:16 +0000 (17:39 +0100)
committerEd Sanders <esanders@wikimedia.org>
Thu, 11 Apr 2019 16:40:47 +0000 (17:40 +0100)
Change-Id: Ib1c94ac66caf6243631aa9d2b9f7fd2e6ca7a367

includes/htmlform/fields/HTMLFormFieldWithButton.php
includes/htmlform/fields/HTMLTextField.php

index 03e479b..93f5363 100644 (file)
@@ -59,6 +59,7 @@ class HTMLFormFieldWithButton extends HTMLFormField {
                        'type' => $this->mButtonType,
                        'label' => $this->mButtonValue,
                        'flags' => $this->mButtonFlags,
+                       'id' => $this->mButtonId,
                ] + OOUI\Element::configFromHtmlAttributes(
                        $this->getAttributes( [ 'disabled', 'tabindex' ] )
                ) );
index 60c63d6..56589b0 100644 (file)
@@ -131,6 +131,9 @@ class HTMLTextField extends HTMLFormField {
                                case 'url':
                                        $type = $this->mParams['type'];
                                        break;
+                               case 'textwithbutton':
+                                       $type = $this->mParams['inputtype'] ?? 'text';
+                                       break;
                        }
                }