Skip to content

Commit

Permalink
fix: set the nSlidesToShow prop correctly (#792)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wagner3UB authored Oct 23, 2024
1 parent b4bf066 commit cc106cf
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 cc106cf

Please sign in to comment.