Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
sortable-dnd
Advanced tools
Make array elements draggable
HTML
<div id="content"></div>
JavaScript
import Sortable from 'sortable-dnd'
var drag = new Sortable({
group: document.getElementById('content'),
draggable: (e) => {
return e.target
},
dragEnd: (pre, cur) => {
...
}
})
When the component you created is destroyed, you need to destroy the drag(new Draggable)
like this
drag.destroy()
option | type | default | Description |
---|---|---|---|
group | HTMLElement | - | List parent element |
scroll | HTMLElement | - | List scroll element. If not passed, the default is the same as the group |
draggable | Function | (e) => e.target | Specifies the drag and drop element, which must return an HTMLElement |
dragEnd | Function | (pre, cur) => {} | The callback function when the drag is completed |
ghostStyle | Object | {} | The style of the mask element when dragging |
ghostClass | String | '' | The class of the mask element when dragging |
animation | Number | 300 | animation delay |
method | Description |
---|---|
destroy | Destroy the component and empty its contents |
FAQs
JS library for drag-and-drop lists, supports sortable and draggable
The npm package sortable-dnd receives a total of 0 weekly downloads. As such, sortable-dnd popularity was classified as not popular.
We found that sortable-dnd demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.