Skip to content

Commit

Permalink
fix: Separate other draggable
Browse files Browse the repository at this point in the history
  • Loading branch information
bebraw committed Oct 25, 2023
1 parent 94217a4 commit d62ed51
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ draggableElement && draggable({ element: draggableElement });
### Draggable with a specific handle

<div id="draggableParent">
<div id="draggable">
<div id="draggabletwo">
<div>Header</div>
<div>Body</div>
</div>
Expand All @@ -32,7 +32,7 @@ draggableElement && draggable({ element: draggableElement });
```typescript
import { draggable } from "dragjs";

const element = document.getElementById("draggable");
const element = document.getElementById("draggabletwo");
const handle = element.children[0];

element && draggable({ element, handle });
Expand Down
11 changes: 11 additions & 0 deletions assets/css/demo.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@
cursor: move;
}

#draggabletwo {
right: 0;
position: absolute;
background-color: #ada;
border: 1px solid black;
width: 100px;
height: 100px;
text-align: center;
cursor: move;
}

#twodContainer {
top: 50px;
left: 50px;
Expand Down

0 comments on commit d62ed51

Please sign in to comment.