Прямо сейчас моя функция вернет true, если if явно вошел в цикл и должен был измениться на false, например:
private recalculateGridViewBottomToTop = (window: fin.OpenFinWindow): boolean => {
const toolbarWindow = fin.desktop.Window.getCurrent();
if (this.windows != null) {
let shiftFromRightToLeft = true;
this.windows.forEach((win) => {
window.getBounds((currentBounds) => {
win.getBounds((bounds) => {
if (bounds.top >= currentBounds.bottom! && bounds.left === currentBounds.left) {
win.leaveGroup();
win.setBounds(bounds.left, bounds.top - currentBounds.height, bounds.width, bounds.height);
toolbarWindow.mergeGroups(win);
shiftFromRightToLeft = false;
}
});
});
});
return shiftFromRightToLeft;
}
shiftFromRightToLeft должен был измениться с истинный на ложный. Мне было интересно, почему этого не происходит?





Согласно вашему коду, если условие выполняется для if (bounds.top >= currentBounds.bottom! && bounds.left === currentBounds.left) {, тогда shiftFromRightToLeft изменит false, иначе он останется true
взгляните на пример ниже:
if (true){
let a = true
if (false){
a = false
}
console.info(a) // output : true
}
попробуйте переместить
let shiftFromRtoL=trueза пределы if