Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
react-native-drag-sort
Advanced tools
Drag and drop sort control for react-native
Add a new scene based on user needs.
The 1.x version ends, the optimizations are optimized, and the problems that have occurred have been resolved. The 2.x version will be written next, and it is expected to add an auto-compatible ScrollView slide, slide delete function, and so on.
Added the top fixed function, you can set the start of several consecutive non-dragable functions, similar to today's headlines, this function is the same as today's headline drag and drop, you can compare
Add a single-line drag-and-drop demo. In fact, this function is consistent. This drag-and-drop plug-in is inherently adaptive. It will take time to optimize the ScrollView problem and make the control bring the ScrollView function。
Optimize drag and drop automatically when not moving, now this plugin should have no problems. Add a real-world demo example, and there will be time to animate this example. When deleting, the item goes down to the item animation to be selected, and the item to be selected is selected. And automatically slide down the animation when sliding。
yarn add react-native-drag-sort
or
npm i react-native-drag-sort --save
<DragSortableView
dataSource={this.state.data}
parentWidth={parentWidth}
childrenWidth= {childrenWidth}
childrenHeight={childrenHeight}
marginChildrenTop={marginChildrenTop}
onDataChange = {(data)=>{
// delete or add data to refresh
if (data.length != this.state.data.length) {
this.setState({
data: data
})
}
}}
keyExtractor={(item,index)=> item.id}
onClickItem={(data,item,index)=>{}}
renderItem={(item,index)=>{
return this.renderItem(item,index)
}}/>
dataSource: PropTypes.array.isRequired :
parentWidth: PropTypes.number //parent width
childrenHeight: PropTypes.number.isRequired, //Each item height
childrenWidth: PropTypes.number.isRequired,//Each item width
marginChildrenTop: PropTypes.number, //So the item's outermost view adds margin, you can only use this method.
marginChildrenBottom: PropTypes.number,
marginChildrenLeft : PropTypes.number,
marginChildrenRight : PropTypes.number,
sortable: PropTypes.bool, //Do not allow dragging
onClickItem: PropTypes.func, //click
onDragStart: PropTypes.func,
onDragEnd : PropTypes.func,
onDataChange : PropTypes.func, //This method is called every time the data changes.
renderItem : PropTypes.func.isRequired, //render item view
fixedItems:PropTypes.array //no remove
keyExtractor: keyExtractor: PropTypes.func //(item,index) => key
delayLongPress: PropTypes.number
isDragFreely: PropTypes.bool, // Whether to limit the drag space
onDragging: PropTypes.func
maxScale: PropTypes.number;
minOpacity: PropTypes.number;
scaleDuration: PropTypes.number;
slideDuration: PropTypes.number;
autoThrottle: PropTypes.number;
autoThrottleDuration: PropTypes.number;
FAQs
Drag and drop sort control for react-native
The npm package react-native-drag-sort receives a total of 1,834 weekly downloads. As such, react-native-drag-sort popularity was classified as popular.
We found that react-native-drag-sort 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
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.