Skip to content

Commit

Permalink
Use action.disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed Dec 24, 2024
1 parent 2ae525f commit 45a1d78
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ function ButtonTrigger< Item >( {
<Button
label={ label }
icon={ action.icon }
disabled={ !! action.disabled }
accessibleWhenDisabled
isDestructive={ action.isDestructive }
size="compact"
onClick={ onClick }
Expand All @@ -90,7 +92,7 @@ function MenuItemTrigger< Item >( {
const label =
typeof action.label === 'string' ? action.label : action.label( items );
return (
<Menu.Item onClick={ onClick }>
<Menu.Item disabled={ action.disabled } onClick={ onClick }>
<Menu.ItemLabel>{ label }</Menu.ItemLabel>
</Menu.Item>
);
Expand Down
4 changes: 4 additions & 0 deletions packages/dataviews/src/dataviews-layouts/list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ function PrimaryActionGridCell< Item >( {
render={
<Button
label={ label }
disabled={ !! primaryAction.disabled }
accessibleWhenDisabled
icon={ primaryAction.icon }
isDestructive={ primaryAction.isDestructive }
size="small"
Expand All @@ -124,6 +126,8 @@ function PrimaryActionGridCell< Item >( {
render={
<Button
label={ label }
disabled={ !! primaryAction.disabled }
accessibleWhenDisabled
icon={ primaryAction.icon }
isDestructive={ primaryAction.isDestructive }
size="small"
Expand Down

0 comments on commit 45a1d78

Please sign in to comment.