Skip to content

Commit

Permalink
change(align): widget to have the default of no value set
Browse files Browse the repository at this point in the history
  • Loading branch information
ichim-david committed Nov 23, 2022
1 parent 831f4fa commit b502a2e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Widgets/Align.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ export const messages = defineMessages({
defaultMessage: 'Full',
},
'': {
id: 'Clear selection',
defaultMessage: 'Clear selection',
id: 'None',
defaultMessage: 'None',
},
});

Expand All @@ -66,6 +66,7 @@ const AlignWidget = (props, rest) => {
onChange,
actions = rest.actions || ['left', 'right', 'center', 'full'],
actionsInfoMap = {},
defaultAction = '',
value,
} = props;

Expand Down Expand Up @@ -98,7 +99,9 @@ const AlignWidget = (props, rest) => {
basic
aria-label={action}
onClick={() => onChange(id, action)}
active={(action === 'center' && !value) || value === action}
active={
(action === defaultAction && !value) || value === action
}
>
<Icon
name={action_info_list[0]}
Expand Down

0 comments on commit b502a2e

Please sign in to comment.