CYS: disable zoom out on fonts/color pairs iframe (#50498)
* CYS: disable zoom out on fonts iframe * Add changefile(s) from automation for the following project(s): woocommerce --------- Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
parent
1561024d6e
commit
7e691560d4
|
@ -246,6 +246,7 @@ function ScaledBlockPreview( {
|
|||
// @ts-ignore disabled prop exists
|
||||
scrolling={ isScrollable ? 'yes' : 'no' }
|
||||
tabIndex={ -1 }
|
||||
canEnableZoomOutView={ true }
|
||||
readonly={
|
||||
! isFullComposabilityFeatureAndAPIAvailable()
|
||||
}
|
||||
|
|
|
@ -41,6 +41,7 @@ function Iframe( {
|
|||
readonly,
|
||||
forwardedRef: ref,
|
||||
title = __( 'Editor canvas', 'woocommerce' ),
|
||||
canEnableZoomOutView = false,
|
||||
...props
|
||||
} ) {
|
||||
const { resolvedAssets } = useSelect( ( select ) => {
|
||||
|
@ -123,7 +124,7 @@ function Iframe( {
|
|||
};
|
||||
}, [] );
|
||||
|
||||
const isZoomedOut = scale !== 1;
|
||||
const isZoomedOut = scale !== 1 && canEnableZoomOutView;
|
||||
|
||||
useEffect( () => {
|
||||
if ( ! isZoomedOut && ! prevContainerWidth.current ) {
|
||||
|
@ -180,7 +181,7 @@ function Iframe( {
|
|||
useEffect( () => cleanup, [ cleanup ] );
|
||||
|
||||
useEffect( () => {
|
||||
if ( ! iframeDocument || ! isZoomedOut ) {
|
||||
if ( ! canEnableZoomOutView || ! iframeDocument || ! isZoomedOut ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -247,6 +248,7 @@ function Iframe( {
|
|||
containerWidth,
|
||||
windowInnerWidth,
|
||||
isZoomedOut,
|
||||
canEnableZoomOutView,
|
||||
] );
|
||||
|
||||
const iframe = (
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
Significance: minor
|
||||
Type: fix
|
||||
|
||||
CYS: disable zoom out on fonts/color pairs iframe
|
Loading…
Reference in New Issue