Skip to content

Commit

Permalink
override to add label id
Browse files Browse the repository at this point in the history
  • Loading branch information
lsat12357 committed Nov 1, 2024
1 parent 7561456 commit 968f7f7
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion app/assets/javascripts/hydra-editor/field_manager.es6
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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')
}
Expand Down

0 comments on commit 968f7f7

Please sign in to comment.