Skip to content

Commit

Permalink
Widget Editor: Don't disable the Save button (#58365)
Browse files Browse the repository at this point in the history
* Widget Editor: Don't disable the Save button

* Update conditions
  • Loading branch information
t-hamano authored Jan 30, 2024
1 parent 375b6ee commit a265123
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/edit-widgets/src/components/save-button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ function SaveButton() {
}, [] );
const { saveEditedWidgetAreas } = useDispatch( editWidgetsStore );

const isDisabled = isSaving || ! hasEditedWidgetAreaIds;

return (
<Button
variant="primary"
isBusy={ isSaving }
aria-disabled={ isSaving }
onClick={ isSaving ? undefined : saveEditedWidgetAreas }
disabled={ ! hasEditedWidgetAreaIds }
aria-disabled={ isDisabled }
onClick={ isDisabled ? undefined : saveEditedWidgetAreas }
>
{ isSaving ? __( 'Saving…' ) : __( 'Update' ) }
</Button>
Expand Down

0 comments on commit a265123

Please sign in to comment.