akiran / akiran/react-slick

Wrong recalculation on page load, of dynamic width of items to show/hide arrows if overflow is true

Open
#2,012 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
11.9k
Forks
2.1k
PR merge metrics
No merged PRs in 30d

Description

This issue is not consistent, but on page load we have an issue when trying to calculate how many `slidesToShow` we have, usually it renders arrows only when we resize the window, and not on page load where we also trigger the calculcation.

In one example of slick it's set slidesToShow to 1 and it’s working but it’s not working for us - if it’s 1 only 1 slide (item) is showing https://react-slick.neostack.com/docs/example/variable-width/
could be because the other properties differ:
`dots: false
infinite: false
centerMode: false
slidesToShow: 1,
slidesToScroll: 1,
variableWidth: true`

Also basically we can’t set a fixed width style attribute because the text is of variable length but even if we do the calculation and set the width it’s only showing 1 slide.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.