Skip to content

Commit

Permalink
fix(core): handle grabCursor within breakpoints
Browse files Browse the repository at this point in the history
fixes #7364
  • Loading branch information
nolimits4web committed Mar 28, 2024
1 parent a7c260a commit e853908
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/core/breakpoints/setBreakpoint.mjs
Expand Up @@ -17,9 +17,13 @@ export default function setBreakpoint() {

const breakpointOnlyParams = breakpoint in breakpoints ? breakpoints[breakpoint] : undefined;
const breakpointParams = breakpointOnlyParams || swiper.originalParams;

const wasMultiRow = isGridEnabled(swiper, params);
const isMultiRow = isGridEnabled(swiper, breakpointParams);

const wasGrabCursor = swiper.params.grabCursor;
const isGrabCursor = breakpointParams.grabCursor;

const wasEnabled = params.enabled;

if (wasMultiRow && !isMultiRow) {
Expand All @@ -38,6 +42,11 @@ export default function setBreakpoint() {
}
swiper.emitContainerClasses();
}
if (wasGrabCursor && !isGrabCursor) {
swiper.unsetGrabCursor();
} else if (!wasGrabCursor && isGrabCursor) {
swiper.setGrabCursor();
}

// Toggle navigation, pagination, scrollbar
['navigation', 'pagination', 'scrollbar'].forEach((prop) => {
Expand Down

0 comments on commit e853908

Please sign in to comment.