Skip to content

Commit

Permalink
Fix: Crash when resetting user color palette. (#36233)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgefilipecosta authored Nov 5, 2021
1 parent 3082c7f commit eb6f8cb
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions packages/components/src/color-edit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ import { ColorPicker } from '../color-picker';
import { FlexItem } from '../flex';
import { HStack } from '../h-stack';
import { ItemGroup } from '../item-group';
import { MenuGroup } from '../menu-group';
import { MenuItem } from '../menu-item';
import { VStack } from '../v-stack';
import ColorPalette from '../color-palette';
import DropdownMenu from '../dropdown-menu';
Expand All @@ -37,6 +35,7 @@ import {
DoneButton,
RemoveButton,
} from './styles';
import { NavigableMenu } from '../navigable-container';

function ColorNameInput( { value, onChange } ) {
return (
Expand Down Expand Up @@ -251,11 +250,11 @@ export default function ColorEdit( { colors = EMPTY_ARRAY, onChange } ) {
isSmall: true,
} }
>
{ ( { onClose = () => {} } ) => (
{ ( { onClose } ) => (
<>
<MenuGroup>
<MenuItem
variant={ 'tertiary' }
<NavigableMenu role="menu">
<Button
variant="tertiary"
onClick={ () => {
setEditingColor( null );
setIsEditing( false );
Expand All @@ -264,8 +263,8 @@ export default function ColorEdit( { colors = EMPTY_ARRAY, onChange } ) {
} }
>
{ __( 'Remove all custom colors' ) }
</MenuItem>
</MenuGroup>
</Button>
</NavigableMenu>
</>
) }
</DropdownMenu>
Expand Down

0 comments on commit eb6f8cb

Please sign in to comment.