svelte-common 6.6.0 → 6.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte-common",
3
- "version": "6.6.0",
3
+ "version": "6.6.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -53,9 +53,15 @@ export class Pagination {
53
53
  if (data?.subscribe) {
54
54
  this.#unsubscribeData = data.subscribe(newData => {
55
55
  this.#data = newData;
56
+ if (this.page > this.numberOfPages) {
57
+ this.page = this.numberOfPages;
58
+ }
56
59
  });
57
60
  } else {
58
61
  this.#data = data;
62
+ if (this.page > this.numberOfPages) {
63
+ this.page = this.numberOfPages;
64
+ }
59
65
  }
60
66
 
61
67
  this.fireSubscriptions();
@@ -153,7 +159,7 @@ export class Pagination {
153
159
  nav.setAttribute("aria-label", "pagination");
154
160
 
155
161
  nav.onkeyup = event => {
156
- const step = (event.altKey ? 10 : 1);
162
+ const step = event.altKey ? 10 : 1;
157
163
 
158
164
  switch (event.key) {
159
165
  case "ArrowLeft":
@@ -256,8 +262,8 @@ export function* navigationItems(
256
262
  break;
257
263
  }
258
264
  }
259
-
260
- /*
265
+
266
+ /*
261
267
  const pageJumps = [
262
268
  { maxPages: 10, stepping: [1] },
263
269
  { maxPages: 100, stepping: [1, 10] },