
Security News
Open Source Maintainers Feeling the Weight of the EU’s Cyber Resilience Act
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
auto-scroll-while-dragging
Advanced tools
This package is used to enhance the auto-scrolling behavior while dragging.
Why? Because the browser native auto-scrolling behavior is uncontrollable or even not working, especially on safari browser.
Talk is meaningless, please check the demo by using different browsers.
npm i auto-scroll-while-dragging
yarn add auto-scroll-while-dragging
pnpm add auto-scroll-while-dragging
import { autoScrollWhileDragging } from 'auto-scroll-while-dragging';
autoScrollWhileDragging({
rootEl: document.body,
gap: 150,
});
import { autoScrollWhileDragging } from 'auto-scroll-while-dragging';
function MyComponent() {
useEffect(() => {
let unbind = autoScrollWhileDragging({ rootEl: document.body, gap: 150 });
return () => unbind();
}, []);
return <></>;
}
autoScrollWhileDragging.dragHandler
).
interface AutoScrollWhileDragging {
(options?: {
/** The root element which will listen the drag event. Default is `document.body`. */
rootEl?: HTMLElement;
/** The scroll speed, default is 0.3 */
speed?: number;
/** The max gap between mouse pointer and the bound of scroll element. Default is `100`, unit is `px`. */
gap?: number;
/** Define delay of throttle dragging. Default is `20`, unit is `ms`. */
throttleDelay?: number;
}): () => void;
dragStartHandler: (e: DragEvent) => void;
dragHandler: (e: DragEvent) => void;
dragEndHandler: () => void;
}
/**
* Enhance the auto-scrolling behavior while dragging.
* It returns a function which will clear effects.
*/
declare const autoScrollWhileDragging: AutoScrollWhileDragging;
export { autoScrollWhileDragging };
MIT License.
1.0.1 (2023-02-02)
Bug1
Bug2
Feature1
Feature2 -->
FAQs
Enhance the auto-scrolling behavior while dragging.
The npm package auto-scroll-while-dragging receives a total of 415 weekly downloads. As such, auto-scroll-while-dragging popularity was classified as not popular.
We found that auto-scroll-while-dragging demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.