Skip to content
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/components/src/components/button/button.lite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ export default function DBButton(props: DBButtonProps) {
aria-describedby={props.describedbyid}
aria-expanded={props.ariaexpanded}
aria-pressed={props.ariapressed}
commandfor={props.commandfor}
command={props.command}
onClick={(event: ClickEvent<HTMLButtonElement>) =>
state.handleClick(event)
}>
Expand Down
10 changes: 10 additions & 0 deletions packages/components/src/components/button/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,16 @@ export type DBButtonDefaultProps = {
* Variant of the button. Use only 1 primary button on a page as CTA otherwise use one of the adaptive buttons.
*/
variant?: ButtonVariantType | string;

/**
* Either standardized or custom actions to be performed on an element that is being controlled by a control <button>, specified via the commandfor attribute. (https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/button#commandfor)
Copy link
Preview

Copilot AI Jul 21, 2025

Choose a reason for hiding this comment

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

The documentation comment appears to be incomplete or unclear. The phrase 'Either standardized or custom actions to be performed on an element that is being controlled by a control ' is confusing. Consider clarifying that this attribute specifies the ID of the element to be controlled.

Suggested change
* Either standardized or custom actions to be performed on an element that is being controlled by a control <button>, specified via the commandfor attribute. (https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/button#commandfor)
* Specifies the ID of the element to be controlled by the button. This attribute is used to associate the button with an interactive element that it controls. (https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/button#commandfor)

Copilot uses AI. Check for mistakes.

*/
commandfor?: string;

/**
* Turns a <button> HTML element into a command button, controlling the given interactive element; takes the ID of the element to control as its value. (https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/button#command)
*/
command?: string;
};

export type DBButtonProps = DBButtonDefaultProps &
Expand Down
Loading