Commit graph

7 commits

Author SHA1 Message Date
Timo Tijhof 93351fb7d9 Use native <input required> instead of JS-based disabled toggling
Remove the JavaScript module and its logic to toggle the disabled
state on the submit button. Instead, let the browser handle this
natively by setting the `required` attribute, which naturally prevents
early submissions.

Retain the current styling for 99% of cases by using the
:required:invalid selector to target the submit button to make it
appear disabled. This slight duplication of styles is needed because,
despite the form effectively being disabled natively, the core
mediawiki-ui styles only account for :disabled on the button directly
and not e.g. inherited via form:invalid. It is also unclear whether
we would want that, since there is some value to be had from having
the form give a consistent look with a progressive button that can
be submitted even at the wrong time to yield an assistive message to
the required field, so hence handling this locally for now instead of
with a generalised approach.

In order to use the required true/false idiom, I have switched the
generating of the HTML string from the old Xml::element method
to Html::element. This means there is no need to store it in an array
first and conditionally set it since true/false will result in absence
or required="" as needed.

As side-effect from this, redundant attributes like value="" and
type="text" are ommitted from the output, just as MediaWiki core does
more generally.

Bug: T283303
Change-Id: I2c75e09dd3f89fa11fca311b4e1f8133946b01b1
2021-05-21 21:04:02 +01:00
Greg Rundlett 1e76fa3fc2 Adding CSS class to hook into SearchSuggest feature
Fixes Bug: T260437

This commit updates unit tests

Change-Id: I36c8c9837c4d1d0beff8ebdb5e86d55937a9e512
2020-08-18 12:40:03 -04:00
C. Scott Ananian a9d0e1fff8 Add newline at end of parser tests file
The new parser tests file parser seems to require it.

Change-Id: I8ab4a8c59ed1b6837dba428f96a8ba0084b7fb68
2020-08-04 14:23:54 -04:00
jenkins-bot d6d9e032c5 Merge "Provide an aria-label attribute option to the input textbox" 2020-04-24 23:37:49 +00:00
Akinwale Alagbe 0d6c2bfc6b Provide an aria-label attribute option to the input textbox
Provide an option to supply the aria-label attribute to the inputbox to 
allow generated markup be accessible to screen readers
<inputbox>
    type=search
    width=120
    buttonlabel=Search
    arialabel=Search this wiki
</inputbox>

Bug: T242354
Change-Id: I40c62bc9889a4912b43244ec65e628ec8bc8533f
2020-04-24 23:05:16 +00:00
C. Scott Ananian e1751bfd26 Update parserTests to v2 (tidy by default)
Bug: T249137
Change-Id: I746ee2b985537dc6bbb8a114e21cd11a683e0f74
2020-04-01 15:44:44 -04:00
Umherirrender 1e200ba116 Update extensions to take advantage of parser test autodiscovery
Bug: T170037
Change-Id: I537f8b2679bc546606856e4bf031efcd52cb381e
2018-04-13 20:15:44 +02:00