Skip to content

Commit 8297003

Browse files
committed
improvements: improved readme
1 parent 2f11726 commit 8297003

File tree

2 files changed

+30
-3
lines changed

2 files changed

+30
-3
lines changed

README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!-- attach gif -->
22
<p align="center">
3-
<img src="./assets/react-simple-drag-selection.gif" alt="react-simple-drag-selection" style="width:900px" />
3+
<img src="https://github.com/badasukerubin/react-simple-drag-selection/blob/v1.0.2/assets/react-simple-drag-selection.gif?raw=true" alt="react-simple-drag-selection" style="width:900px" />
44
</p>
55

66
# react-simple-drag-selection
@@ -90,10 +90,25 @@ A simple and configurable React library that provides an efficient and effective
9090
- `onSelectionEnd`: Optional callback function that is called when the selection ends
9191

9292
4. `useDragSelected` has the following options:
93+
9394
- `elementRef`: React ref to the element that you want to check if it is selected
9495
- `selection`: The selection object that is provided by the `DragSelectionContext`
9596
- `onSelected`: Optional callback function that is called when the element is selected
9697

98+
5. You can also ignore elements from having the selection logic interfere with their default behaviour (or that of their descendants) by adding the `ignore-drag-selection` class to them.
99+
100+
```tsx
101+
<div className="ignore-drag-selection">
102+
<div className="box" draggable={true} ondragstart={dragFunction}></div>
103+
</div>
104+
```
105+
97106
## Example
98107

99-
A full example can be found in the [example](./example/) directory.
108+
A full example can be found in the [example](https://github.com/badasukerubin/react-simple-drag-selection/tree/main/example) directory.
109+
110+
## Roadmap
111+
112+
- [ ] Unselect/Select using Shift and Meta keys
113+
- [ ] Add tests
114+
- [ ] Mobile/touch selection support

package.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,17 @@
2727
"files": [
2828
"dist"
2929
],
30-
"types": "dist/index.d.ts"
30+
"types": "dist/index.d.ts",
31+
"keywords": [
32+
"react",
33+
"drag",
34+
"selection",
35+
"drag-selection",
36+
"react-drag-selection",
37+
"react-simple-drag-selection"
38+
],
39+
"repository": {
40+
"type": "git",
41+
"url": "https://github.com/badasukerubin/react-simple-drag-selection.git"
42+
}
3143
}

0 commit comments

Comments
 (0)