File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
packages/block-editor/src/components/global-styles Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -394,11 +394,16 @@ function BackgroundSizeToolsPanelItem( {
394394 const updateBackgroundSize = ( next ) => {
395395 // When switching to 'contain' toggle the repeat off.
396396 let nextRepeat = repeatValue ;
397+ let nextPosition = positionValue ;
397398
398399 if ( next === 'contain' ) {
399400 nextRepeat = 'no-repeat' ;
400401 }
401402
403+ if ( next !== 'contain' && nextPosition === 'center' ) {
404+ nextPosition = undefined ;
405+ }
406+
402407 if ( next === 'cover' ) {
403408 nextRepeat = undefined ;
404409 }
@@ -414,6 +419,7 @@ function BackgroundSizeToolsPanelItem( {
414419 onChange (
415420 setImmutably ( style , [ 'background' ] , {
416421 ...style ?. background ,
422+ backgroundPosition : nextPosition ,
417423 backgroundRepeat : nextRepeat ,
418424 backgroundSize : next ,
419425 } )
You can’t perform that action at this time.
0 commit comments