Skip to content

Commit c7a7aeb

Browse files
committed
remove debounce on horizonal scroll, fixes #789
1 parent b458c23 commit c7a7aeb

File tree

1 file changed

+22
-26
lines changed

1 file changed

+22
-26
lines changed

slick.grid.js

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ if (typeof Slick === "undefined") {
108108
viewportMinWidthPx: undefined,
109109
viewportMaxWidthPx: undefined,
110110
suppressCssChangesOnHiddenInit: false,
111-
scrollDebounceDelay: -1, // add a scroll delay to avoid screen flickering, -1 to disable delay
112111
ffMaxSupportedCssHeight: 6000000,
113112
maxSupportedCssHeight: 1000000000,
114113
sanitizer: undefined, // sanitize function, built in basic sanitizer is: Slick.RegexSanitizer(dirtyHtml)
@@ -4350,34 +4349,31 @@ if (typeof Slick === "undefined") {
43504349
prevScrollLeft = scrollLeft;
43514350

43524351
// adjust scroll position of all div containers when scrolling the grid
4353-
// user can optionally provide "scrollDebounceDelay" grid option if flickering are a problem
4354-
utils.debounce(() => {
4355-
_viewportScrollContainerX.scrollLeft = scrollLeft;
4356-
_headerScrollContainer.scrollLeft = scrollLeft;
4357-
_topPanelScrollers[0].scrollLeft = scrollLeft;
4358-
if (options.createFooterRow) {
4359-
_footerRowScrollContainer.scrollLeft = scrollLeft;
4360-
}
4361-
if (options.createPreHeaderPanel) {
4362-
if (hasFrozenColumns()) {
4363-
_preHeaderPanelScrollerR.scrollLeft = scrollLeft;
4364-
} else {
4365-
_preHeaderPanelScroller.scrollLeft = scrollLeft;
4366-
}
4367-
}
4368-
4352+
_viewportScrollContainerX.scrollLeft = scrollLeft;
4353+
_headerScrollContainer.scrollLeft = scrollLeft;
4354+
_topPanelScrollers[0].scrollLeft = scrollLeft;
4355+
if (options.createFooterRow) {
4356+
_footerRowScrollContainer.scrollLeft = scrollLeft;
4357+
}
4358+
if (options.createPreHeaderPanel) {
43694359
if (hasFrozenColumns()) {
4370-
if (hasFrozenRows) {
4371-
_viewportTopR.scrollLeft = scrollLeft;
4372-
}
4373-
_headerRowScrollerR.scrollLeft = scrollLeft; // right header row scrolling with frozen grid
4360+
_preHeaderPanelScrollerR.scrollLeft = scrollLeft;
43744361
} else {
4375-
if (hasFrozenRows) {
4376-
_viewportTopL.scrollLeft = scrollLeft;
4377-
}
4378-
_headerRowScrollerL.scrollLeft = scrollLeft; // left header row scrolling with regular grid
4362+
_preHeaderPanelScroller.scrollLeft = scrollLeft;
43794363
}
4380-
}, options.scrollDebounceDelay)();
4364+
}
4365+
4366+
if (hasFrozenColumns()) {
4367+
if (hasFrozenRows) {
4368+
_viewportTopR.scrollLeft = scrollLeft;
4369+
}
4370+
_headerRowScrollerR.scrollLeft = scrollLeft; // right header row scrolling with frozen grid
4371+
} else {
4372+
if (hasFrozenRows) {
4373+
_viewportTopL.scrollLeft = scrollLeft;
4374+
}
4375+
_headerRowScrollerL.scrollLeft = scrollLeft; // left header row scrolling with regular grid
4376+
}
43814377
}
43824378

43834379
// autoheight suppresses vertical scrolling, but editors can create a div larger than

0 commit comments

Comments
 (0)