Skip to content

Commit

Permalink
Try using Mix as placeholder for mixed values
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronrobertshaw committed Sep 28, 2022
1 parent 0f2b87c commit a10eb32
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ export default function AllInputControl( {

const hasValues = hasDefinedValues( values );
const isMixed = hasValues && hasMixedValues( values );
const allPlaceholder = isMixed ? __( 'Mixed' ) : null;
const allPlaceholder = isMixed
? /* translators: Placeholder text representing a mix of values. */
__( 'Mix' )
: null;

// Filter out CSS-unit-only values to prevent invalid styles.
const handleOnChange = ( next ) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ const BorderBoxControl = (
enableStyle={ enableStyle }
onChange={ onLinkedChange }
placeholder={
hasMixedBorders ? __( 'Mixed' ) : undefined
hasMixedBorders
? /* translators: Placeholder text representing a mix of values. */
__( 'Mix' )
: undefined
}
__unstablePopoverProps={ popoverProps }
shouldSanitizeBorder={ false } // This component will handle that.
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/border-box-control/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ describe( 'BorderBoxControl', () => {
clickButton( 'Link sides' );

const widthInput = screen.getByRole( 'spinbutton' );
expect( widthInput ).toHaveAttribute( 'placeholder', 'Mixed' );
expect( widthInput ).toHaveAttribute( 'placeholder', 'Mix' );
} );

it( 'should render shared border width when switching to linked view', async () => {
Expand Down

0 comments on commit a10eb32

Please sign in to comment.