Skip to content

Commit 968f7f7

Browse files
committed
override to add label id
1 parent 7561456 commit 968f7f7

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

app/assets/javascripts/hydra-editor/field_manager.es6

+11-1
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ export class FieldManager {
2222
this.init();
2323
}
2424

25+
// call _addInitialID
2526
init() {
2627
this._addInitialClasses();
27-
this._addAriaLiveRegions()
28+
this._addInitialID();
29+
this._addAriaLiveRegions();
2830
this._appendControls();
2931
this._attachEvents();
3032
this._addCallbacks();
@@ -35,6 +37,14 @@ export class FieldManager {
3537
$(this.fieldWrapperClass, this.element).addClass("input-group input-append");
3638
}
3739

40+
// ensure ID is assigned
41+
_addInitialID() {
42+
let id = this.element.find('.multi_value.form-control').attr('id') + '_' + 'label';
43+
if (id != "undefined_label"){
44+
this.element.find('label').attr('id', id);
45+
}
46+
}
47+
3848
_addAriaLiveRegions() {
3949
$(this.element).find('.listing').attr('aria-live', 'polite')
4050
}

0 commit comments

Comments
 (0)