Skip to content

Commit 217b388

Browse files
fix(toolbar): sync horizontal scroll icon state on mode switch (#5173)
Check scrollBlockContainer state when switching to Advanced mode to show correct icon instead of always showing 'Enable' icon. Closes #5077
1 parent a234436 commit 217b388

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

js/toolbar.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,18 +1170,22 @@ class Toolbar {
11701170
delPluginIcon.onclick = () => delPlugin_onclick(this.activity);
11711171
}
11721172

1173-
// Horizontal Scroll
1173+
// Horizontal Scroll - sync icon state with current scroll setting
11741174
const enableHorizScrollIcon = docById("enableHorizScrollIcon");
11751175
const disableHorizScrollIcon = docById("disableHorizScrollIcon");
11761176

1177-
if (enableHorizScrollIcon) {
1178-
enableHorizScrollIcon.style.display = "block";
1177+
if (enableHorizScrollIcon && disableHorizScrollIcon) {
1178+
// Show correct icon based on current scroll state
1179+
if (this.activity.scrollBlockContainer) {
1180+
enableHorizScrollIcon.style.display = "none";
1181+
disableHorizScrollIcon.style.display = "block";
1182+
} else {
1183+
enableHorizScrollIcon.style.display = "block";
1184+
disableHorizScrollIcon.style.display = "none";
1185+
}
11791186
enableHorizScrollIcon.onclick = () => {
11801187
setScroller(this.activity);
11811188
};
1182-
}
1183-
1184-
if (disableHorizScrollIcon) {
11851189
disableHorizScrollIcon.onclick = () => {
11861190
setScroller(this.activity);
11871191
};

0 commit comments

Comments
 (0)