Skip to content

Commit

Permalink
Fixing test
Browse files Browse the repository at this point in the history
  • Loading branch information
rismehta authored and ci-build committed Oct 24, 2024
1 parent 3b2cbee commit b4149df
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
if (fieldType !== 'form' && this.parentView.setFocus) {
this.parentView.setFocus(this.getId());
}
this.setActive();
this.element.scrollIntoView({ behavior: 'smooth', block: 'start' });
}

Expand Down
3 changes: 2 additions & 1 deletion ui.frontend/src/view/FormField.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ class FormField {
setActive() {
if (!this.isActive()) {
this.element.setAttribute(Constants.DATA_ATTRIBUTE_ACTIVE, true);
if (this.parentView) {
// optimizing the performance to check if the activeChild is different, else this will be a redundant call
if (this.parentView?._model?.activeChild !== this._model) {
this.parentView._model.activeChild = this._model; // updating the activeChild of the model when a field is focused in view
}
this.active = true;
Expand Down

0 comments on commit b4149df

Please sign in to comment.