Skip to content

Commit

Permalink
Fix: Coloring panel is unusable in RTL (#37644)
Browse files Browse the repository at this point in the history
Co-authored-by: George Mamadashvili <[email protected]>
  • Loading branch information
jorgefilipecosta and Mamaduka committed Dec 29, 2021
1 parent b7d6b23 commit 8744b81
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
ColorIndicator,
Dropdown,
} from '@wordpress/components';
import { isRTL } from '@wordpress/i18n';

/**
* Internal dependencies
Expand All @@ -33,7 +32,7 @@ export default function ColorGradientSettingsDropdown( {
} ) {
let dropdownPosition;
if ( __experimentalIsRenderedInSidebar ) {
dropdownPosition = isRTL() ? 'bottom right' : 'bottom left';
dropdownPosition = 'bottom left';
}

return (
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/color-palette/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import classnames from 'classnames';
/**
* WordPress dependencies
*/
import { __, sprintf, isRTL } from '@wordpress/i18n';
import { __, sprintf } from '@wordpress/i18n';
import { useCallback, useMemo } from '@wordpress/element';

/**
Expand Down Expand Up @@ -150,7 +150,7 @@ export default function ColorPalette( {

let dropdownPosition;
if ( __experimentalIsRenderedInSidebar ) {
dropdownPosition = isRTL() ? 'bottom right' : 'bottom left';
dropdownPosition = 'bottom left';
}

const colordColor = colord( value );
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/custom-gradient-bar/control-points.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { colord } from 'colord';
*/
import { useInstanceId } from '@wordpress/compose';
import { useEffect, useRef, useState, useMemo } from '@wordpress/element';
import { __, sprintf, isRTL } from '@wordpress/i18n';
import { __, sprintf } from '@wordpress/i18n';
import { plus } from '@wordpress/icons';
import { LEFT, RIGHT } from '@wordpress/keycodes';

Expand Down Expand Up @@ -86,7 +86,7 @@ function GradientColorPickerDropdown( {
};
if ( isRenderedInSidebar ) {
result.anchorRef = gradientPickerDomRef.current;
result.position = isRTL() ? 'bottom right' : 'bottom left';
result.position = 'bottom left';
}
return result;
}, [ gradientPickerDomRef.current, isRenderedInSidebar ] );
Expand Down

0 comments on commit 8744b81

Please sign in to comment.