poe-svelte-ui-lib 1.31.4 → 1.31.5
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/dist/Table/Table.svelte +3 -5
- package/package.json +1 -1
package/dist/Table/Table.svelte
CHANGED
|
@@ -79,6 +79,8 @@
|
|
|
79
79
|
|
|
80
80
|
const handleScroll = () => {
|
|
81
81
|
if (!container) return
|
|
82
|
+
/* Контейнер рендерится только при наличии строк, поэтому слушатель — в разметке, а не addEventListener в onMount */
|
|
83
|
+
if (autoscroll) handleAutoScroll()
|
|
82
84
|
const { scrollTop, clientHeight, scrollHeight } = container
|
|
83
85
|
if (scrollTop + clientHeight >= scrollHeight - 50 && cursor !== null && loader && !loader()) {
|
|
84
86
|
getData()
|
|
@@ -212,10 +214,7 @@
|
|
|
212
214
|
})
|
|
213
215
|
|
|
214
216
|
onMount(() => {
|
|
215
|
-
if (autoscroll)
|
|
216
|
-
container?.addEventListener("scroll", handleAutoScroll)
|
|
217
|
-
scrollToBottom()
|
|
218
|
-
}
|
|
217
|
+
if (autoscroll) scrollToBottom()
|
|
219
218
|
|
|
220
219
|
const handlePageScroll = () => {
|
|
221
220
|
isDropdownOpen = null
|
|
@@ -231,7 +230,6 @@
|
|
|
231
230
|
isScrollable = container ? container.scrollHeight > container.clientHeight : false
|
|
232
231
|
|
|
233
232
|
return () => {
|
|
234
|
-
container?.removeEventListener("scroll", handleAutoScroll)
|
|
235
233
|
window.removeEventListener("scroll", handlePageScroll, true)
|
|
236
234
|
window.removeEventListener("resize", handlePageScroll, true)
|
|
237
235
|
}
|