You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the breakpoint changes, Swiper doesn't update the grabCursor state until the slider is swiped. However this only happens for false -> true state transition not true -> false. I mean if the grabCursor state is true and we resize the window to a breakpoint in which the grabCursor is set to false, it won't get updated even after the user's swipe.
20240311_112223.mp4
Expected Behavior
No response
Actual Behavior
The grabCursor state should get updated immediately when the breakpoint changes.
Additionally, it would be beneficial if Swiper could merge breakpoint parameters (not just grabCursor) from one breakpoint to the next.
As you can see, from 350 breakpoint onwards, the grabCursor is set to false and from 560 breakpoint onwards, the grabCursor is set to true. To avoid redundancy, I prefer to omit the repeated property and write it as follows:
Check that this is really a bug
Reproduction link
https://codesandbox.io/p/sandbox/swiper-grabcursor-bug-n6p2r5?file=%2Fsrc%2FApp.js%3A11%2C26
Bug description
If we want to have different behavior for
grabCursor
for some breakpoints like this:When the breakpoint changes, Swiper doesn't update the
grabCursor
state until the slider is swiped. However this only happens forfalse -> true
state transition nottrue -> false
. I mean if thegrabCursor
state istrue
and we resize the window to a breakpoint in which thegrabCursor
is set tofalse
, it won't get updated even after the user's swipe.20240311_112223.mp4
Expected Behavior
No response
Actual Behavior
The
grabCursor
state should get updated immediately when the breakpoint changes.Additionally, it would be beneficial if Swiper could merge breakpoint parameters (not just
grabCursor
) from one breakpoint to the next.For example in this code:
As you can see, from
350
breakpoint onwards, thegrabCursor
is set tofalse
and from560
breakpoint onwards, thegrabCursor
is set totrue
. To avoid redundancy, I prefer to omit the repeated property and write it as follows:Swiper version
11.0.7
Platform/Target and Browser Versions
Chrome 122.0.6261, Firefox 123.0.1
Validations
Would you like to open a PR for this bug?
The text was updated successfully, but these errors were encountered: