Skip to content

Commit 141c3aa

Browse files
committed
[INTERNAL] sap.f.FCL: Resume visible columns to clear suspension state
Columns could remain permanently suspended when animation mode changed from "full" to "none" mid-session. Root cause: The resumeResizeHandler flag was only set to true when animations were enabled (bSuspendResizeHandler && !bHidden). When animation mode changed to "none", bSuspendResizeHandler became false, so columns that were suspended during previous animations were never resumed. Fix: Always resume visible columns (!bHidden) regardless of animation mode. ResizeHandler.resume() is safe to call on non-suspended elements - it simply returns false without side effects. Change-Id: If48b0c5f607cf3aeef157857c7ad1c21e7fda6be CR-Id: 002075125900000202692026 SNOW: CS20260011773107 (cherry picked from commit ef61e93)
1 parent f8ba8ab commit 141c3aa

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

src/sap.f/src/sap/f/FlexibleColumnLayout.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1461,7 +1461,13 @@ sap.ui.define([
14611461
bResizeColumnWithAnimation = this._canResizeColumnWithAnimation(sColumn, oColumnConfig),
14621462
bSuspendResizeHandler = bAnimationsEnabled,
14631463
fnAfterResizeCallback = this._afterColumnResize.bind(this, sColumn, merge(oColumnConfig, {
1464-
resumeResizeHandler: bSuspendResizeHandler && !bHidden // toggle back after resize
1464+
// Always resume visible columns to clear any leftover suspension state.
1465+
// This handles the case when animation mode changes from "full" to "none"
1466+
// mid-session - without this, columns suspended during animations would
1467+
// stay suspended forever since bSuspendResizeHandler becomes false.
1468+
// Calling ResizeHandler.resume() on a non-suspended element is safe and
1469+
// simply returns false without any side effects.
1470+
resumeResizeHandler: !bHidden
14651471
})),
14661472
fnResizeErrorCallback = function() {
14671473
ResizeHandler.resume(oColumnDomRef);

src/sap.f/test/sap/f/qunit/FlexibleColumnLayout.qunit.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,6 +1059,40 @@ function(
10591059
});
10601060
});
10611061

1062+
QUnit.test("Suspended columns are resumed when animation mode changes from 'full' to 'none'", function (assert) {
1063+
// arrange
1064+
var fnDone = assert.async(),
1065+
sOriginalAnimationMode = ControlBehavior.getAnimationMode(),
1066+
oBeginColumnDomRef = this.oFCL._$columns["begin"].get(0),
1067+
oMidColumnDomRef = this.oFCL._$columns["mid"].get(0),
1068+
oResumeSpy = this.spy(ResizeHandler, "resume");
1069+
1070+
// act: change layout with animations enabled (columns get suspended)
1071+
this.oFCL.setLayout(LT.TwoColumnsMidExpanded);
1072+
1073+
this.oFCL._attachAfterAllColumnsResizedOnce(function () {
1074+
setTimeout(function () {
1075+
oResumeSpy.resetHistory();
1076+
1077+
// act: switch animation mode to 'none'
1078+
ControlBehavior.setAnimationMode("none");
1079+
1080+
// act: change layout again - this should resume any suspended columns
1081+
this.oFCL.setLayout(LT.TwoColumnsBeginExpanded);
1082+
1083+
// assert: resume is called for visible columns even though animations are disabled
1084+
assert.ok(oResumeSpy.calledWith(oBeginColumnDomRef),
1085+
"ResizeHandler.resume called for begin column when animation mode is 'none'");
1086+
assert.ok(oResumeSpy.calledWith(oMidColumnDomRef),
1087+
"ResizeHandler.resume called for mid column when animation mode is 'none'");
1088+
1089+
// cleanup
1090+
ControlBehavior.setAnimationMode(sOriginalAnimationMode);
1091+
fnDone();
1092+
}.bind(this), 0);
1093+
}.bind(this));
1094+
});
1095+
10621096
QUnit.test("_getPreviousLayout", function (assert) {
10631097
var sLayoutBeforeUpdate = this.oFCL.getLayout();
10641098
this.oFCL.setLayout(LT.TwoColumnsMidExpanded);

0 commit comments

Comments
 (0)