I noticed a bug in the way the id
attributes are created for repeatable subform fields in the JavaScript. On line 163 in subform-repeatable.js
there is this:
id = name.replace(/(\]|\[\]$)/g, '').replace(/\[/g, '_')
which in the end produces id attributes like jform_contacts_contacts3_is_primary0
. Unfortunately, the id attributes in the subform templates are in the format of jform_contacts__contactsX__is_primary
, so the correct result should be something like jform_contacts__contacts3__is_primary0
, with double underscores.
Because the id
attribute doesn't match what is in the templates, the label elements get broken because their for
attribute ends up being jform_contacts__contactsX__is_primary0
or similar, that is, the X does not get replaced.
A quick and dirty fix is to replace aforementioned line with
id = name.replace(/(\]\[)/g, '__').replace(/(\[)/g, '_').replace(/(\]$)/g, '')
but I'm sure there is a smarter way, too.
Labels |
Added:
?
|
Category | ⇒ | Fields JavaScript |
Priority | Medium | ⇒ | Low |
Status | New | ⇒ | Confirmed |
Closed_By | franz-wohlkoenig | ⇒ | joomla-cms-bot |
Status | Confirmed | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-06-03 15:39:34 |
Closed_By | ⇒ | franz-wohlkoenig |
closed as having PR #16480
Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/15187
I can confirm the issue,
Additionally:
<fieldset class="radio">
of radio buttons, also has "unfixed" id