Skip to content

Commit

Permalink
fix(ui5-view-settings-dialog): fix circular dependency JS error (#4844)
Browse files Browse the repository at this point in the history
Fixes circular dependency JS error by removing self reference associatedItem property in initSortByItems getters

FIXES: #4837
  • Loading branch information
Todor-ads authored and ilhan007 committed Mar 2, 2022
1 parent c09b0c4 commit 057a7d8
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/fiori/src/ViewSettingsDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,6 @@ class ViewSettingsDialog extends UI5Element {
return {
text: item.text,
selected: item.selected,
associatedItem: item,
index,
};
});
Expand Down Expand Up @@ -565,8 +564,7 @@ class ViewSettingsDialog extends UI5Element {
sortDescending = !this._currentSettings.sortOrder[0].selected,
sortBy = _currentSortBySelected && _currentSortBySelected.text,
sortByElementIndex = _currentSortBySelected && _currentSortBySelected.index,
initSortIByItem = this.initSortByItems.find((item, index) => index === sortByElementIndex),
sortByItem = initSortIByItem && initSortIByItem.associatedItem;
sortByItem = this.sortItems[sortByElementIndex];
return {
sortOrder,
sortDescending,
Expand Down

0 comments on commit 057a7d8

Please sign in to comment.