Skip to content

Commit 1eb40c7

Browse files
committed
feat(button): added commandfor and command attributes
1 parent 5c1af7d commit 1eb40c7

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

packages/components/src/components/button/button.lite.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ export default function DBButton(props: DBButtonProps) {
5151
aria-describedby={props.describedbyid}
5252
aria-expanded={props.ariaexpanded}
5353
aria-pressed={props.ariapressed}
54+
commandfor={props.commandfor}
55+
command={props.command}
5456
onClick={(event: ClickEvent<HTMLButtonElement>) =>
5557
state.handleClick(event)
5658
}>

packages/components/src/components/button/model.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,16 @@ export type DBButtonDefaultProps = {
7979
* Variant of the button. Use only 1 primary button on a page as CTA otherwise use one of the adaptive buttons.
8080
*/
8181
variant?: ButtonVariantType | string;
82+
83+
/**
84+
* 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)
85+
*/
86+
commandfor?: string;
87+
88+
/**
89+
* 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)
90+
*/
91+
command?: string;
8292
};
8393

8494
export type DBButtonProps = DBButtonDefaultProps &

0 commit comments

Comments
 (0)