Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rc-virtual-list

Package Overview
Dependencies
Maintainers
2
Versions
128
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-virtual-list - npm Package Compare versions

Comparing version 3.10.5 to 3.10.6

28

es/hooks/useFrameWheel.js

@@ -17,5 +17,4 @@ import { useRef } from 'react';

var originScroll = useOriginScroll(isScrollAtTop, isScrollAtBottom);
function onWheelY(event) {
function onWheelY(event, deltaY) {
raf.cancel(nextFrameRef.current);
var deltaY = event.deltaY;
offsetRef.current += deltaY;

@@ -37,4 +36,3 @@ wheelValueRef.current = deltaY;

}
function onWheelX(event) {
var deltaX = event.deltaX;
function onWheelX(event, deltaX) {
onWheelDelta(deltaX, true);

@@ -45,3 +43,3 @@ if (!isFF) {

}
// Check for which direction does wheel do
// Check for which direction does wheel do. `sx` means `shift + wheel`
var wheelDirectionRef = useRef(null);

@@ -57,12 +55,20 @@ var wheelDirectionCleanRef = useRef(null);

var deltaX = event.deltaX,
deltaY = event.deltaY;
var absX = Math.abs(deltaX);
var absY = Math.abs(deltaY);
deltaY = event.deltaY,
shiftKey = event.shiftKey;
var mergedDeltaX = deltaX;
var mergedDeltaY = deltaY;
if (wheelDirectionRef.current === 'sx' || !wheelDirectionRef.current && (shiftKey || false) && deltaY && !deltaX) {
mergedDeltaX = deltaY;
mergedDeltaY = 0;
wheelDirectionRef.current = 'sx';
}
var absX = Math.abs(mergedDeltaX);
var absY = Math.abs(mergedDeltaY);
if (wheelDirectionRef.current === null) {
wheelDirectionRef.current = horizontalScroll && absX > absY ? 'x' : 'y';
}
if (wheelDirectionRef.current === 'x') {
onWheelX(event);
if (wheelDirectionRef.current === 'y') {
onWheelY(event, mergedDeltaY);
} else {
onWheelY(event);
onWheelX(event, mergedDeltaX);
}

@@ -69,0 +75,0 @@ }

@@ -24,5 +24,4 @@ "use strict";

var originScroll = (0, _useOriginScroll.default)(isScrollAtTop, isScrollAtBottom);
function onWheelY(event) {
function onWheelY(event, deltaY) {
_raf.default.cancel(nextFrameRef.current);
var deltaY = event.deltaY;
offsetRef.current += deltaY;

@@ -44,4 +43,3 @@ wheelValueRef.current = deltaY;

}
function onWheelX(event) {
var deltaX = event.deltaX;
function onWheelX(event, deltaX) {
onWheelDelta(deltaX, true);

@@ -52,3 +50,3 @@ if (!_isFirefox.default) {

}
// Check for which direction does wheel do
// Check for which direction does wheel do. `sx` means `shift + wheel`
var wheelDirectionRef = (0, _react.useRef)(null);

@@ -64,12 +62,20 @@ var wheelDirectionCleanRef = (0, _react.useRef)(null);

var deltaX = event.deltaX,
deltaY = event.deltaY;
var absX = Math.abs(deltaX);
var absY = Math.abs(deltaY);
deltaY = event.deltaY,
shiftKey = event.shiftKey;
var mergedDeltaX = deltaX;
var mergedDeltaY = deltaY;
if (wheelDirectionRef.current === 'sx' || !wheelDirectionRef.current && (shiftKey || false) && deltaY && !deltaX) {
mergedDeltaX = deltaY;
mergedDeltaY = 0;
wheelDirectionRef.current = 'sx';
}
var absX = Math.abs(mergedDeltaX);
var absY = Math.abs(mergedDeltaY);
if (wheelDirectionRef.current === null) {
wheelDirectionRef.current = horizontalScroll && absX > absY ? 'x' : 'y';
}
if (wheelDirectionRef.current === 'x') {
onWheelX(event);
if (wheelDirectionRef.current === 'y') {
onWheelY(event, mergedDeltaY);
} else {
onWheelY(event);
onWheelX(event, mergedDeltaX);
}

@@ -76,0 +82,0 @@ }

{
"name": "rc-virtual-list",
"version": "3.10.5",
"version": "3.10.6",
"description": "React Virtual List Component",

@@ -5,0 +5,0 @@ "engines": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc