Slider dots are not hidden when slides are all visible
When there is a simple carousel with (for example) 4 elements and all of them are currently visible, the dot is not automatically hidden like in previous versions.
I expect the dot(s) to only show when a fifth element is attached to the carousel.
====================================================================
See this fiddle:
[ https://jsfiddle.net/f2cf73wz/ ]
====================================================================
Hi, same problem, I have added an "if( _.slideCount > _.options.slidesToShow ) {" from "buildArrows" function
Slick.prototype.buildDots = function() {
var _ = this,
i, dot;
if (_.options.dots === true) {
if( _.slideCount > _.options.slidesToShow ) {
_.$slider.addClass('slick-dotted');
dot = $('<ul />').addClass(_.options.dotsClass);
for (i = 0; i <= _.getDotCount(); i += 1) {
dot.append($('<li />').append(_.options.customPaging.call(this, _, i)));
}
_.$dots = dot.appendTo(_.options.appendDots);
_.$dots.find('li').first().addClass('slick-active').attr('aria-hidden', 'false');
}
}
};
Maybe is worth to someone: the problem itself appears only with the minified version (v. 1.8.1) of the file. With the non minified version all is good.
Same problem, but it works correct on not minimized script.
Can use a workaround by hiding the ul if only one li is available. For example
.slick-dotted > ul.slick-dots {
&:has(:only-child) {
display: none;
}
}