Skip to content

Commit

Permalink
Button: Improve disabled-related prop descriptions (#57864)
Browse files Browse the repository at this point in the history
  • Loading branch information
mirka authored Jan 16, 2024
1 parent 56c02a0 commit f478dfe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/components/src/button/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ An accessible description for the button.

#### `disabled`: `boolean`

Whether the button is disabled. If `true`, this will force a `button` element to be rendered.
Whether the button is disabled. If `true`, this will force a `button` element to be rendered, even when an `href` is given.

- Required: No

Expand Down
10 changes: 7 additions & 3 deletions packages/components/src/button/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,23 +115,27 @@ type BaseButtonProps = {
*/
variant?: 'primary' | 'secondary' | 'tertiary' | 'link';
/**
* Whether this is focusable.
* Whether to keep the button focusable when disabled.
*
* @default false
*/
__experimentalIsFocusable?: boolean;
};

type _ButtonProps = {
/**
* Whether the button is disabled.
* If `true`, this will force a `button` element to be rendered.
*
* If `true`, this will force a `button` element to be rendered, even when an `href` is given.
*/
disabled?: boolean;
};

type AnchorProps = {
/**
* Whether the button is disabled.
* If `true`, this will force a `button` element to be rendered.
*
* If `true`, this will force a `button` element to be rendered, even when an `href` is given.
*/
disabled?: false;
/**
Expand Down

1 comment on commit f478dfe

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in f478dfe.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7548867489
📝 Reported issues:

Please sign in to comment.