Skip to content

Commit

Permalink
Remove recursively updating parent in the view when focus is triggered
Browse files Browse the repository at this point in the history
  • Loading branch information
ravise5 committed Sep 18, 2023
1 parent bf3e37e commit abd59ed
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions ui.frontend/src/view/FormField.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,11 @@ class FormField {
setActive() {
if (!this.isActive()) {
this.element.setAttribute(Constants.DATA_ATTRIBUTE_ACTIVE, true);
if(this.parentView && this.parentView._model.activeChild !== this._model) {
if(this.parentView) {
this.parentView._model.activeChild = this._model; // updating the activeChild of the model when a field is focused in view
}
this.active = true;
}
if (this.parentView && this.parentView.setActive) {
this.parentView.setActive();
}
}

/**
Expand All @@ -95,9 +92,6 @@ class FormField {
this.element.setAttribute(Constants.DATA_ATTRIBUTE_ACTIVE, false);
this.active = false;
}
if (this.parentView && this.parentView.setInactive) {
this.parentView.setInactive();
}
}

/**
Expand Down

0 comments on commit abd59ed

Please sign in to comment.