-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Responsive Breakpoints Issue #414
Comments
Hi, I had the same issue and commented on it here: #381 (comment). It seems to be caused by the changes introduced in #382. Downgrading to 2.8.2 helped, but it is not ideal. |
Hi, thanks for your reply. I haven't tried downgrading to 2.8.2, but I found a workaround for this issue using an event listener and react hooks from this website. First, declare the initial state of the innerWidth and innerHeight Then, create a function within useEffect that sets the innerWidth and innerHeight. We can use this function as the listener. Use the 'resize' and 'orientationchange' listener to detect orientation changes for mobile and tablet devices. Don't forget to use the removeEventListener for the cleanup function. `useEffect(()=> {
Since the responsive property is not working as it's supposed to, I created a breakpoint functions for the number of items in the carousel.
While this workaround works, I do think is also not ideal. Hopefully, the breakpoint issue will be fixed. |
Hi, I'm also experiencing this same behavior on 2.8.4. I have confirmed that the issue is resolved by downgraded to 2.8.2. Any status on this issue? |
Describe the bug
The responsive breakpoint didn't seem to work properly when I tried to run the React app on tablet or mobile devices. For example, the iPad that I'm using has a width viewport of 1080px in landscape mode. However, when I set the 'desktop' to a minimum of 1024px with 3 items, it only shows 2 items on my iPad. Another example is on mobile where the width viewport of the mobile is 800px in landscape mode. When I ran it on mobile in landscape mode, it only showed one item instead of two. If I inspect it on Chrome, however, the responsive breakpoint seems to be working properly.
To Reproduce
Steps to reproduce the behavior:
Set the responsive breakpoint the same as the one in the demo SSR:
responsive={{ desktop: { breakpoint: { max: 3000, min: 1024 }, items: 3, partialVisibilityGutter: 40 }, mobile: { breakpoint: { max: 464, min: 0 }, items: 1, partialVisibilityGutter: 30 }, tablet: { breakpoint: { max: 1024, min: 464 }, items: 2, partialVisibilityGutter: 30 } }}
Expected behavior
It is supposed to show 3 items on a tablet with a 1080px viewport and two items on a mobile with an 800px width viewport in landscape mode.
Screenshots
Additional context
Add any other context about the problem here.
Reproduction
Link to codesandbox.
The text was updated successfully, but these errors were encountered: