glide icon indicating copy to clipboard operation
glide copied to clipboard

Keep last item fixed on the right edge

Open JFonsecaSpot opened this issue 8 years ago • 8 comments

When navigating and selecting the last item, keep the last item positioned on the right side of the glider.

image

Currently selecting the last item gives you this.

image

It would be an improvement if it resulted in this state:

image

JFonsecaSpot avatar Apr 04 '18 10:04 JFonsecaSpot

+1

Djules avatar Apr 21 '18 22:04 Djules

+1

kevgk avatar Apr 27 '18 15:04 kevgk

+1

Abby805 avatar Jun 04 '18 14:06 Abby805

Has anyone found a good workaround for this? I love everything else about this library, but this is a dealbreaker for my design team, unfortunately.

Abby805 avatar Jun 04 '18 14:06 Abby805

Just introduced new bound option for this feature with https://github.com/glidejs/glide/commit/12928dfce7e32ef70ac1452a2f3fdaa660d7fb23. Would be great if anyone take it for a test run :)

jedrzejchalubek avatar Jun 28 '18 19:06 jedrzejchalubek

@jedrzejchalubek It works great, although I think it gives an unexpected outcome when the number of items in slider is less than perPage.

kitties1

I would expect the slider to be "draggable" but leave the slides in their place, but the outcome is as on following screen: kitties2

patryk-bernasiewicz avatar Jul 03 '18 07:07 patryk-bernasiewicz

@jedrzejchalubek I made a quick fix for that, but I can't really tell how proper that is in the scope of whole script.

It's to return 0 if length of slides is less than perView setting.

        define(Run, 'length', {
            /**
             * Gets value of the running distance based
             * on zero-indexing number of slides.
             *
             * @return {Number}
             */
            get: function get() {
                var settings = Glide.settings;

                var length = Components.Html.slides.length;

                if (settings.perView > length) return 0;

                if (Glide.isType('slider') && settings.bound) {
                    return length - 1 - (toInt(settings.perView) - 1) + toInt(settings.focusAt);
                }

                return length - 1;
            }
        });

patryk-bernasiewicz avatar Jul 03 '18 07:07 patryk-bernasiewicz

bound option has been introduced with v3.2.0 release

jedrzejchalubek avatar Jul 22 '18 13:07 jedrzejchalubek