Skip to content

Commit ddb6336

Browse files
committed
fix(grid): enable horizontal scrolling via locked regions (#9631)
1 parent 5b9f809 commit ddb6336

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

src/grid/ScrollManager.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,13 +315,15 @@ class ScrollManager extends Base {
315315
if (active) {
316316
let scrollerId = me.gridContainer.horizontalScrollbar?.id,
317317
bodyId = me.gridContainer.body?.id,
318+
bodyWrapperId = me.gridContainer.bodyWrapper?.id,
318319
headerId = me.gridContainer.headerToolbar?.id;
319320

320321
if (scrollerId && bodyId && headerId) {
321322
addon.register({
322323
id: me.id + '__h_scroll',
323324
scrollerId,
324325
bodyId,
326+
bodyWrapperId,
325327
headerId,
326328
windowId
327329
});

src/main/addon/GridHorizontalScrollSync.mjs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,10 @@ class GridHorizontalScrollSync extends Base {
6868
* @param {String} data.id
6969
* @param {String} data.scrollerId
7070
* @param {String} data.bodyId
71+
* @param {String} data.bodyWrapperId
7172
* @param {String} data.headerId
7273
*/
73-
register({id, scrollerId, bodyId, headerId}) {
74+
register({id, scrollerId, bodyId, bodyWrapperId, headerId}) {
7475
let me = this,
7576
registration;
7677

@@ -82,13 +83,14 @@ class GridHorizontalScrollSync extends Base {
8283
id,
8384
scrollerId,
8485
bodyId,
86+
bodyWrapperId,
8587
headerId,
8688
scrollListener: me.onScroll.bind(me, scrollerId, bodyId, headerId),
8789
wheelListener : me.onWheel.bind(me, scrollerId)
8890
};
8991

9092
DomAccess.getElement(scrollerId)?.addEventListener('scroll', registration.scrollListener);
91-
DomAccess.getElement(bodyId)?.addEventListener('wheel', registration.wheelListener, {passive: true});
93+
DomAccess.getElement(bodyWrapperId || bodyId)?.addEventListener('wheel', registration.wheelListener, {passive: true});
9294

9395
me.registrations.set(id, registration);
9496
}
@@ -103,7 +105,7 @@ class GridHorizontalScrollSync extends Base {
103105

104106
if (registration) {
105107
DomAccess.getElement(registration.scrollerId)?.removeEventListener('scroll', registration.scrollListener);
106-
DomAccess.getElement(registration.bodyId)?.removeEventListener('wheel', registration.wheelListener);
108+
DomAccess.getElement(registration.bodyWrapperId || registration.bodyId)?.removeEventListener('wheel', registration.wheelListener);
107109
me.registrations.delete(id);
108110
}
109111
}

0 commit comments

Comments
 (0)