Fix cys frame zooming in/out while moving mouse over

This commit is contained in:
Chi-Hsuan Huang 2023-11-03 13:57:41 +08:00
parent d2cd2ff35a
commit 54d3394ac4
2 changed files with 8 additions and 21 deletions

View File

@ -145,35 +145,15 @@ export const Layout = () => {
</NavigableRegion> </NavigableRegion>
{ ! isMobileViewport && ( { ! isMobileViewport && (
<div <div className="edit-site-layout__canvas-container">
className={ classnames(
'edit-site-layout__canvas-container'
) }
>
{ canvasResizer } { canvasResizer }
{ !! canvasSize.width && ( { !! canvasSize.width && (
<motion.div <motion.div
whileHover={ {
scale: 1.005,
transition: {
duration: disableMotion
? 0
: 0.5,
ease: 'easeOut',
},
} }
initial={ false } initial={ false }
layout="position" layout="position"
className={ classnames( className={ classnames(
'edit-site-layout__canvas' 'edit-site-layout__canvas'
) } ) }
transition={ {
type: 'tween',
duration: disableMotion
? 0
: ANIMATION_DURATION,
ease: 'easeOut',
} }
> >
<ErrorBoundary> <ErrorBoundary>
<ResizableFrame <ResizableFrame

View File

@ -244,6 +244,13 @@ function ResizableFrame( {
if ( definition === 'fullWidth' ) if ( definition === 'fullWidth' )
setFrameSize( { width: '100%', height: '100%' } ); setFrameSize( { width: '100%', height: '100%' } );
} } } }
whileHover={ {
scale: 1.005,
transition: {
duration: 0.5,
ease: 'easeOut',
},
} }
transition={ frameTransition } transition={ frameTransition }
size={ frameSize } size={ frameSize }
enable={ { enable={ {