-
-
Notifications
You must be signed in to change notification settings - Fork 629
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix floating point for min limit size
- Loading branch information
Showing
9 changed files
with
50 additions
and
11 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
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
35 changes: 35 additions & 0 deletions
35
packages/react-moveable/stories/99-Tests/ReactGroupMinSizeApp.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,35 @@ | ||
import * as React from "react"; | ||
import Moveable from "@/react-moveable"; | ||
|
||
export default function App() { | ||
return <div className="container"> | ||
<div className="target target1">Target1</div> | ||
<div className="target target2">Target2</div> | ||
<div className="target target3">Target3</div> | ||
<Moveable | ||
target={".target"} | ||
draggable={true} | ||
resizable={true} | ||
onResizeGroupStart={({ events }) => { | ||
events[0].setMin([50, 50]); | ||
events[1].setMin([60, 50]); | ||
events[2].setMin([50, 60]); | ||
}} | ||
onResizeGroup={({ events }) => { | ||
events.forEach(ev => { | ||
ev.target.style.width = `${ev.width}px`; | ||
ev.target.style.height = `${ev.height}px`; | ||
ev.target.style.transform = ev.drag.transform; | ||
}); | ||
}} | ||
onDragGroup={({ events }) => { | ||
events.forEach(ev => { | ||
ev.target.style.transform = ev.transform; | ||
}); | ||
}} | ||
onDragGroupEnd={({ events }) => { | ||
console.log(events); | ||
}} | ||
/> | ||
</div>; | ||
} |
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