Page MenuHomePhabricator

There should be a way to add classes to a button in HTMLForm, but not its wrapper div
Closed, ResolvedPublic

Description

If you have an element, e.g. a submit button, you can create it with this definition:

$button = array(
  'type' => 'submit',
  'name' => 'buttonname',
  'cssclass' => 'mw-ui-button mw-ui-destructive',
)

If you now create a form with a div layout or a vform the class mentioned in cssclass is added to the wrapper div and the button itself, which makes the whole fiv a mw-ui-button (any following element hasn't a margin e.g.). That seems totally false, so, for a div layout, the class shouldn't be added to the wrapper div?

Event Timeline

Florian created this task.Jun 17 2015, 4:09 PM
Florian raised the priority of this task from to Needs Triage.
Florian updated the task description. (Show Details)
Florian added a project: MediaWiki-HTMLForm.
Florian added subscribers: Florian, matmarex.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 17 2015, 4:09 PM

Hmm, perhaps we should just handle the 'flags' parameter (just added in 1025f0a79c0ac5d02806ca24fc9c54513d63a7cf) in non-OOUI display formats, too? That's probably the only use case.

Florian claimed this task.Jul 9 2015, 4:58 PM

That sounds like a good idea :) I think in favour of OOUI Forms a very simple implementation would be enough.

Change 223831 had a related patch set uploaded (by Florianschmidtwelzow):
HTMLForm: Handle Flags in non-OOUI form buttons, too

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

matmarex renamed this task from cssclass shouldn't add the class to a wrapper div to There should be a way to add classes to a button in HTMLForm, but not its wrapper div.Jul 11 2015, 2:15 PM
matmarex closed this task as Resolved.
matmarex removed a project: Patch-For-Review.
matmarex set Security to None.

Change 223831 merged by jenkins-bot:
HTMLForm: Handle Flags in non-OOUI form buttons, too

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