intelliwaketssveltekitv25 1.0.16 → 1.0.17

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.
@@ -31,6 +31,8 @@
31
31
  let bottom = $state(0)
32
32
  let average_height: number | undefined = $state()
33
33
 
34
+ let is_scrolling = false
35
+
34
36
  let visible = $derived(
35
37
  items.slice(start, end).map((data, i) => ({
36
38
  index: i + start,
@@ -79,7 +81,9 @@
79
81
  }
80
82
 
81
83
  async function handle_scroll() {
82
- if (!viewport || !rows) return
84
+ if (!viewport || !rows || is_scrolling) return
85
+
86
+ is_scrolling = true
83
87
 
84
88
  const { scrollTop } = viewport
85
89
 
@@ -135,12 +139,12 @@
135
139
  }
136
140
 
137
141
  const d = actual_height - expected_height
138
- viewport.scrollTo(0, scrollTop + d)
142
+ if (d !== 0) {
143
+ viewport.scrollTo(0, scrollTop + d)
144
+ }
139
145
  }
140
146
 
141
- // TODO if we overestimated the space these
142
- // rows would occupy we may need to add some
143
- // more. maybe we can just call handle_scroll again?
147
+ is_scrolling = false
144
148
  }
145
149
 
146
150
  // trigger initial refresh
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intelliwaketssveltekitv25",
3
- "version": "1.0.16",
3
+ "version": "1.0.17",
4
4
  "exports": {
5
5
  ".": {
6
6
  "types": "./dist/index.d.ts",