Skip to content

Commit 5d3400f

Browse files
committed
fix: scrolling mode can hide autoly
1 parent 7c3379c commit 5d3400f

1 file changed

Lines changed: 20 additions & 16 deletions

File tree

packages/vtable/src/event/listener/scroll-bar.ts

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,40 +37,44 @@ export function bindScrollBarListener(eventManager: EventManager) {
3737
}
3838
});
3939
scenegraph.component.vScrollBar.addEventListener('pointerout', (e: any) => {
40-
if (verticalVisible !== 'focus') {
41-
return;
42-
}
4340
if (stateManager.interactionState === InteractionState.scrolling) {
4441
return;
4542
}
46-
stateManager.hideVerticalScrollBar();
43+
if (verticalVisible === 'focus') {
44+
stateManager.hideVerticalScrollBar();
45+
} else if (verticalVisible === 'scrolling') {
46+
stateManager.showVerticalScrollBar(true);
47+
}
4748
});
4849
scenegraph.component.hScrollBar.addEventListener('pointerout', (e: any) => {
49-
if (horizontalVisible !== 'focus') {
50-
return;
51-
}
5250
if (stateManager.interactionState === InteractionState.scrolling) {
5351
return;
5452
}
55-
stateManager.hideHorizontalScrollBar();
53+
if (horizontalVisible === 'focus') {
54+
stateManager.hideHorizontalScrollBar();
55+
} else if (horizontalVisible === 'scrolling') {
56+
stateManager.showHorizontalScrollBar(true, 'body');
57+
}
5658
});
5759
scenegraph.component.frozenHScrollBar.addEventListener('pointerout', (e: any) => {
58-
if (horizontalVisible !== 'focus') {
59-
return;
60-
}
6160
if (stateManager.interactionState === InteractionState.scrolling) {
6261
return;
6362
}
64-
stateManager.hideHorizontalScrollBar();
63+
if (horizontalVisible === 'focus') {
64+
stateManager.hideHorizontalScrollBar();
65+
} else if (horizontalVisible === 'scrolling') {
66+
stateManager.showHorizontalScrollBar(true, 'frozen');
67+
}
6568
});
6669
scenegraph.component.rightFrozenHScrollBar.addEventListener('pointerout', (e: any) => {
67-
if (horizontalVisible !== 'focus') {
68-
return;
69-
}
7070
if (stateManager.interactionState === InteractionState.scrolling) {
7171
return;
7272
}
73-
stateManager.hideHorizontalScrollBar();
73+
if (horizontalVisible === 'focus') {
74+
stateManager.hideHorizontalScrollBar();
75+
} else if (horizontalVisible === 'scrolling') {
76+
stateManager.showHorizontalScrollBar(true, 'rightFrozen');
77+
}
7478
});
7579
scenegraph.component.vScrollBar.addEventListener('pointermove', (e: FederatedPointerEvent) => {
7680
scenegraph.table.stateManager.updateCursor('default');

0 commit comments

Comments
 (0)