Page MenuHomePhabricator

Class and style attributes has no effect on the standard input tag
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue

In a form, add a standard input tag with class and style attributes. E.g. {{{standard input|summary|label=A label for testing|class=a-css-class|style="display:none;"}}}

What happens?

The class and style attributes are not included in any HTML element of the form.

OOUI\Element() only accept classes and no style config attribute.

Software version

ProductVersion
MediaWiki1.35.6
PHP7.4.27 (fpm-fcgi)
MariaDB10.3.32
ICU65.1
Lua5.1.5
ExtensionVersion
PageForms5.4 master (ae078b8)

Event Timeline

This is sort of on purpose - there are indeed no "class" or "style" parameters for "standard input", or any of the other form definition tags. My thought was that, if you want to do any custom formatting, you can put a <div> or <span> tag around any part of the form definition (like the "free text" tag), and then apply CSS to that, either inline or somewhere like MediaWiki:Common.css.

I forgot to mention that class and style are described in the documentation of Page Forms. I just wanted to use these attributes thinking they worked. But yes, you’re right, I have other solutions to add CSS classes.

Oh! Sorry, I must have forgotten. :) I'll have to look into this, then.

Change 840042 had a related patch set uploaded (by Yaron Koren; author: Yaron Koren):

[mediawiki/extensions/PageForms@master] Restore support for "class" param for some standard inputs

https://gerrit.wikimedia.org/r/840042

Change 840042 merged by jenkins-bot:

[mediawiki/extensions/PageForms@master] Restore support for "class" param for some standard inputs

https://gerrit.wikimedia.org/r/840042

Yaron_Koren claimed this task.

I assume this is resolved now...