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.
@@ -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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "poe-svelte-ui-lib",
3
- "version": "1.31.4",
3
+ "version": "1.31.5",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "scripts": {