
Research
/Security News
Contagious Interview Campaign Escalates With 67 Malicious npm Packages and New Malware Loader
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
react-element-pan
Advanced tools
React component for allowing panning of DOM-elements too large for their container, in a Google Maps-like way.
React component for allowing panning of DOM-elements too large for their container, in a Google Maps-like way. Supports touch devices and should work on IE8+.
See the demos page for some demos.
react-element-pan
can be installed using npm:
npm install react-element-pan
const React = require('react')
const ReactDOM = require('react-dom')
const ElementPan = require('react-element-pan')
// Or, with JSX:
ReactDOM.render(
<ElementPan
width={800} // Optional width for the ElementPan container
height={800} // Optional height for the ElementPan container
startX={771} // Optional X coordinate to start at
startY={360} // Optional Y coordinate to start at
onPanStart={() => {
/* Pan started! */
}}
onPanStop={() => {
/* Pan ended! */
}}
onPan={() => {
/* Pan move! */
}}
>
<img src="some-large-image.jpg" />
</ElementPan>,
document.body
)
Note that startX/startY only works if the content is large enough when the component is mounted. You might want to set a min-width
/min-height
in your CSS for this to work.
A quick note on the firefox browser. The default behavior on mouseDown
in firefox on images is "drag to copy". If you wish to avoid the ghost
image, prevent default on mousedown on your image:
ReactDOM.render(
<ElementPan>
<img src="some-large-image.jpg" onMouseDown={evt => evt.preventDefault()} />
</ElementPan>,
document.body
)
Licensed under the MIT License, see LICENSE
FAQs
React component for allowing panning of DOM-elements too large for their container, in a Google Maps-like way.
The npm package react-element-pan receives a total of 208 weekly downloads. As such, react-element-pan popularity was classified as not popular.
We found that react-element-pan 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.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.