|
1 | 1 | import { defineComponent, ref, onMounted, onBeforeUnmount, onUpdated, watch, computed, openBlock, createElementBlock, renderSlot, createCommentVNode, createElementVNode, Fragment } from "vue";
|
2 | 2 | /*!
|
3 | 3 | * Splide.js
|
4 |
| - * Version : 3.1.6 |
| 4 | + * Version : 3.1.7 |
5 | 5 | * License : MIT
|
6 | 6 | * Copyright: 2021 Naotoshi Fujita
|
7 | 7 | */
|
@@ -170,6 +170,9 @@ function style(elm, prop, value) {
|
170 | 170 | function display(elm, display2) {
|
171 | 171 | style(elm, "display", display2);
|
172 | 172 | }
|
| 173 | +function focus(elm) { |
| 174 | + elm["setActive"] && elm["setActive"]() || elm.focus({ preventScroll: true }); |
| 175 | +} |
173 | 176 | function getAttribute(elm, attr) {
|
174 | 177 | return elm.getAttribute(attr);
|
175 | 178 | }
|
@@ -1180,8 +1183,8 @@ function Move(Splide2, Components2, options) {
|
1180 | 1183 | return position;
|
1181 | 1184 | }
|
1182 | 1185 | function offset(index) {
|
1183 |
| - const { focus } = options; |
1184 |
| - return focus === "center" ? (listSize() - slideSize(index, true)) / 2 : +focus * slideSize(index) || 0; |
| 1186 | + const { focus: focus2 } = options; |
| 1187 | + return focus2 === "center" ? (listSize() - slideSize(index, true)) / 2 : +focus2 * slideSize(index) || 0; |
1185 | 1188 | }
|
1186 | 1189 | function getLimit(max2) {
|
1187 | 1190 | return toPosition(max2 ? Components2.Controller.getEnd() : 0, !!options.trimSpace);
|
@@ -1771,12 +1774,12 @@ function Drag(Splide2, Components2, options) {
|
1771 | 1774 | function coordOf(e, orthogonal) {
|
1772 | 1775 | return (isTouchEvent(e) ? e.touches[0] : e)[`page${resolve(orthogonal ? "Y" : "X")}`];
|
1773 | 1776 | }
|
1774 |
| - function isTouchEvent(e) { |
1775 |
| - return typeof TouchEvent !== "undefined" && e instanceof TouchEvent; |
1776 |
| - } |
1777 | 1777 | function timeOf(e) {
|
1778 | 1778 | return e.timeStamp;
|
1779 | 1779 | }
|
| 1780 | + function isTouchEvent(e) { |
| 1781 | + return typeof TouchEvent !== "undefined" && e instanceof TouchEvent; |
| 1782 | + } |
1780 | 1783 | function constrain(diff) {
|
1781 | 1784 | return diff / (hasExceeded && Splide2.is(SLIDE) ? FRICTION : 1);
|
1782 | 1785 | }
|
@@ -1969,7 +1972,7 @@ function Pagination(Splide2, Components2, options) {
|
1969 | 1972 | function onClick(page) {
|
1970 | 1973 | Controller2.go(`>${page}`, true, () => {
|
1971 | 1974 | const Slide2 = Slides2.getAt(Controller2.toIndex(page));
|
1972 |
| - Slide2 && Slide2.slide.focus(); |
| 1975 | + Slide2 && focus(Slide2.slide); |
1973 | 1976 | });
|
1974 | 1977 | }
|
1975 | 1978 | function getAt(index) {
|
|
0 commit comments