-
-
Notifications
You must be signed in to change notification settings - Fork 909
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add pointer capture to pointer events (#3066)
* Adding pointer capture * Latest * Latest * v12.4.4-alpha.0 * Fixing test * Dry pointer capture
- Loading branch information
1 parent
609ddb2
commit 2ca6370
Showing
24 changed files
with
338 additions
and
134 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { AnimatePresence, motion } from "framer-motion" | ||
import { useEffect, useState } from "react" | ||
|
||
export const App = () => { | ||
const [width, setWidth] = useState(100) | ||
const [presenceState, setPresenceState] = useState(true) | ||
|
||
useEffect(() => { | ||
if (width === 200) return | ||
const timeout = setTimeout(() => { | ||
setWidth(50) | ||
|
||
setTimeout(() => { | ||
setWidth(200) | ||
}, 1000) | ||
}, 1000) | ||
|
||
return () => clearTimeout(timeout) | ||
}, [width]) | ||
|
||
useEffect(() => { | ||
setTimeout(() => { | ||
setPresenceState(false) | ||
}, 2100) | ||
}, [presenceState]) | ||
|
||
return ( | ||
<> | ||
<AnimatePresence initial={false}> | ||
{presenceState && ( | ||
<motion.div exit={{ opacity: 0 }}> | ||
<motion.div | ||
layout | ||
style={{ | ||
width, | ||
height: 100, | ||
background: "red", | ||
}} | ||
> | ||
Presence | ||
</motion.div> | ||
</motion.div> | ||
)} | ||
</AnimatePresence> | ||
</> | ||
) | ||
} |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"version": "12.4.3", | ||
"version": "12.4.4-alpha.0", | ||
"packages": [ | ||
"packages/*", | ||
"dev/*" | ||
|
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
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
Oops, something went wrong.