Page MenuHomePhabricator

Label hack in API sandbox does nothing
Closed, ResolvedPublic

Description

Since https://gerrit.wikimedia.org/r/#/c/332398 you can't pass a $label to a fieldLayout so the hack in mediawiki.special.sandbox.js L:1582 does nothing.

Event Timeline

I don't know what "IE hack" you're talking about here. ApiSandbox is passing $label so it can set a 'click' event on it, FieldLayout's sometimes-forwarding isn't sufficient. There doesn't seem to be a documented way to get the generated label element, only to set it.

Change 351336 had a related patch set uploaded (by Anomie; owner: Anomie):
[mediawiki/core@master] mw.special.apisandbox: Don't pass $label to OO.ui.FieldLayout

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

I don't know what "IE hack" you're talking about here.

I must be going senile - I thought I read "InternetExplorer" in a comment, but apparently not.

Esanders renamed this task from IE label hack in api sandbox does nothing to Label hack in API sandbox does nothing.May 2 2017, 8:59 PM

I didn't realize that this even could be done, much less that somebody would actually be doing it. Sorry.

I think that this entire thing is actually a bug in OOjs UI – you shouldn't need to override bits of FieldLayout to make it focus the field when the label is clicked. I filed T164506 for this. I think we can clean up a few gnarly things if we make this work consistently, actually.

Change 351336 merged by jenkins-bot:
[mediawiki/core@master] mw.special.apisandbox: Don't pass $label to OO.ui.FieldLayout

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