-
-
Notifications
You must be signed in to change notification settings - Fork 626
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
55 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
packages/react-moveable/stories/99-Tests/ReactNestedSVGApp.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import * as React from "react"; | ||
import Moveable from "@/react-moveable"; | ||
|
||
export default function App() { | ||
return <div className="container"> | ||
<svg viewBox="0 0 200 200" style={{ | ||
border: "1px solid black", | ||
width: "200px", | ||
height: "200px", | ||
}}> | ||
<svg viewBox="0 0 200 200" style={{ | ||
border: "1px solid black", | ||
width: "200px", | ||
height: "200px", | ||
}}> | ||
<path d="M 0 0 L 200 0 L 200 200 z" | ||
className="svg" | ||
style={{ | ||
fill: "white", | ||
stroke: "red", | ||
strokeWidth: 2, | ||
}} /> | ||
</svg> | ||
</svg> | ||
<Moveable | ||
target={".svg"} | ||
draggable={true} | ||
preventClickDefault={true} | ||
onDrag={e => { | ||
e.target.style.transform = e.transform; | ||
}} | ||
/> | ||
</div>; | ||
} |