Implement HTMLFormFieldCloner in OOUIHTMLForm
Description
Details
Project | Branch | Lines +/- | Subject | |
---|---|---|---|---|
mediawiki/core | master | +168 -42 | Add OOUI for HTMLFormFieldCloner |
Related Objects
Event Timeline
Change 421373 had a related patch set uploaded (by Mainframe98; owner: Mainframe98):
[mediawiki/core@master] Add OOUI for HTMLFormFieldCloner
Change 421373 abandoned by Mainframe98:
Add OOUI for HTMLFormFieldCloner
Reason:
Unable to work on this now
Change 421373 merged by jenkins-bot:
[mediawiki/core@master] Add OOUI for HTMLFormFieldCloner
Known issue with the patch:
There is also one problem with the functionality: all of the fields added in JS are generated with identical "id" attributes, so clicking their labels will focus the first one, rather than the correct one. This is a bit hard to explain, so here's a video:
(I used this code for testing, based on the one you gave me: https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/463121)I'm not sure how to fix this. You might be able to do it with some clever replacing in cloner.js (like with the 'uniqueId'), but that seems very unreliable.
The proper way to do this would be to not use HTML "templates" for OOUI widgets, but instead construct new widgets from the config options. But at a glance, that would require a lot of refactoring in HTMLFormField (there's no way to get the config options out of it). :/
In my opinion this is not a severe enough problem to block the patch from being merged (although it may be severe enough to discourage you from using HTMLFormFieldCloner in your OOUIHTMLForm).