Skip to content

Commit

Permalink
fix: set the nSlidesToShow prop correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Wagner3UB committed Oct 23, 2024
1 parent b4bf066 commit 3790142
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/ItaliaTheme/Blocks/Listing/SliderTemplate.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,10 @@ const SliderTemplate = ({
}) => {
const intl = useIntl();
const [userAutoplay, setUserAutoplay] = useState(autoplay);
const nSlidesToShow = parseInt(slidesToShow);
const nSlidesToShow =
items.length < parseInt(slidesToShow)
? items.length
: parseInt(slidesToShow);
const Slider = reactSlick.default;
const { slider, focusNext } = useSlider(userAutoplay);
const toggleAutoplay = () => {
Expand Down

0 comments on commit 3790142

Please sign in to comment.