virtua 0.46.1 → 0.46.3

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.
@@ -417,6 +417,10 @@ const createVirtualStore = (elementsCount, itemSize = 40, ssrCount = 0, cacheSna
417
417
  let mutated = 0;
418
418
  switch (type) {
419
419
  case ACTION_SCROLL: {
420
+ if (payload === scrollOffset && _scrollMode === SCROLL_BY_NATIVE) {
421
+ // Ignore scroll events from different direction
422
+ break;
423
+ }
420
424
  const flushedJump = _flushedJump;
421
425
  _flushedJump = 0;
422
426
  const delta = payload - scrollOffset;
@@ -1118,7 +1122,8 @@ const createWindowResizer = (store, isHorizontal) => {
1118
1122
  store.$update(ACTION_VIEWPORT_RESIZE, window[windowSizeKey]);
1119
1123
  };
1120
1124
  window.addEventListener("resize", onWindowResize);
1121
- onWindowResize();
1125
+ // https://github.com/inokawa/virtua/issues/792
1126
+ microtask(onWindowResize);
1122
1127
  cleanupOnWindowResize = () => {
1123
1128
  window.removeEventListener("resize", onWindowResize);
1124
1129
  };