diff --git a/packages/block-editor/src/components/block-mover/button.js b/packages/block-editor/src/components/block-mover/button.js index aa6ad9f227e49a..5502aebe20c697 100644 --- a/packages/block-editor/src/components/block-mover/button.js +++ b/packages/block-editor/src/components/block-mover/button.js @@ -46,6 +46,11 @@ const getDirection = ( direction, orientation ) => { return isRTL() ? 'right' : 'left'; } return 'up'; + } else if ( direction === 'down' ) { + if ( orientation === 'horizontal' ) { + return isRTL() ? 'left' : 'right'; + } + return 'down'; } return null; }; diff --git a/packages/components/src/tooltip/index.tsx b/packages/components/src/tooltip/index.tsx index 663c7a3595420b..d21ba40303027a 100644 --- a/packages/components/src/tooltip/index.tsx +++ b/packages/components/src/tooltip/index.tsx @@ -94,6 +94,15 @@ function UnforwardedTooltip( showTimeout: delay, } ); + const getGutterValue = () => { + if ( direction === 'up' ) { + return 28; + } else if ( direction === 'down' ) { + return 8; + } + return 4; + }; + const mounted = tooltipStore.useState( 'mounted' ); if ( isNestedInTooltip ) { @@ -131,7 +140,7 @@ function UnforwardedTooltip( { ...restProps } className={ clsx( 'components-tooltip', className ) } unmountOnHide - gutter={ direction === 'up' ? 28 : 4 } + gutter={ getGutterValue() } id={ describedById } overflowPadding={ 0.5 } store={ tooltipStore }