react-reorder-list 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ To install react-reorder-list
|
|
|
25
25
|
|
|
26
26
|
Items in this list can be reordered by simply dragging an item and dropping it in place of another item.
|
|
27
27
|
#### Basic Usage
|
|
28
|
-
|
|
28
|
+
Each `<div>` component inside `<ReorderList>` can now be drag-and-dropped to another `<div>` to reorder them.
|
|
29
29
|
```jsx
|
|
30
30
|
import React from 'react'
|
|
31
31
|
import ReorderList from 'react-reorder-list'
|
|
@@ -40,7 +40,11 @@ export default function App() {
|
|
|
40
40
|
}
|
|
41
41
|
```
|
|
42
42
|
#### Usage with ReorderIcon
|
|
43
|
-
|
|
43
|
+
The dragging behavior can be changed using the `useOnlyIconToDrag` prop of `<ReorderList>` component.
|
|
44
|
+
|
|
45
|
+
If set to `true`, an item can be dragged only using the `<ReorderIcon>` present inside the item.
|
|
46
|
+
|
|
47
|
+
If set to `false`, an item can be dragged by clicking anywhere inside the item.
|
|
44
48
|
```jsx
|
|
45
49
|
import React from 'react'
|
|
46
50
|
import ReorderList, { ReorderIcon } from 'react-reorder-list'
|
|
@@ -68,6 +72,7 @@ export default function App() {
|
|
|
68
72
|
return <ReorderList>
|
|
69
73
|
{[0, 1, 2].map(i => {
|
|
70
74
|
return <div key={i}>
|
|
75
|
+
<ReorderIcon />
|
|
71
76
|
<span>{'Parent' + i}</span>
|
|
72
77
|
<ReorderList useOnlyIconToDrag={true}>
|
|
73
78
|
{[0, 1, 2].map(j => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-reorder-list",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "A simple react component that facilitates the reordering of JSX/HTML elements through drag-and-drop functionality, allowing for easy position changes.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|