diff --git a/app/assets/javascripts/hydra-editor/field_manager.es6 b/app/assets/javascripts/hydra-editor/field_manager.es6 index a6db59aab0..8b663fe48f 100644 --- a/app/assets/javascripts/hydra-editor/field_manager.es6 +++ b/app/assets/javascripts/hydra-editor/field_manager.es6 @@ -22,9 +22,11 @@ export class FieldManager { this.init(); } + // call _addInitialID init() { this._addInitialClasses(); - this._addAriaLiveRegions() + this._addInitialID(); + this._addAriaLiveRegions(); this._appendControls(); this._attachEvents(); this._addCallbacks(); @@ -35,6 +37,14 @@ export class FieldManager { $(this.fieldWrapperClass, this.element).addClass("input-group input-append"); } + // ensure ID is assigned + _addInitialID() { + let id = this.element.find('.multi_value.form-control').attr('id') + '_' + 'label'; + if (id != "undefined_label"){ + this.element.find('label').attr('id', id); + } + } + _addAriaLiveRegions() { $(this.element).find('.listing').attr('aria-live', 'polite') }