Skip to content

Commit 5ba8181

Browse files
authored
feat: add command and commandfor attributes for button (closes #4193) (#4194)
1 parent 30b917c commit 5ba8181

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

tachys/src/html/attribute/key.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,10 @@ attributes! {
195195
cols "cols",
196196
/// The `colspan` attribute defines the number of columns a cell should span.
197197
colspan "colspan",
198+
/// The `command` attribute defines the command to be invoked when user clicks the `<button>` element which has `commandfor` attribute specified.
199+
command "command",
200+
/// The `commandfor` attribute defines the id of the element which button is controlling. It is generic version of `popovertarget`.
201+
commandfor "commandfor",
198202
/// The `content` attribute gives the value associated with the http-equiv or name attribute.
199203
content "content",
200204
/// The `contenteditable` attribute indicates whether the element's content is editable.

tachys/src/html/element/elements.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ html_elements! {
249249
/// The `<body>` HTML element represents the content of an HTML document. There can be only one `<body>` element in a document.
250250
body HtmlBodyElement [] true,
251251
/// The `<button>` HTML element represents a clickable button, used to submit forms or anywhere in a document for accessible, standard button functionality.
252-
button HtmlButtonElement [disabled, form, formaction, formenctype, formmethod, formnovalidate, formtarget, name, r#type, value, popovertarget, popovertargetaction] true,
252+
button HtmlButtonElement [command, commandfor, disabled, form, formaction, formenctype, formmethod, formnovalidate, formtarget, name, r#type, value, popovertarget, popovertargetaction] true,
253253
/// Use the HTML `<canvas>` element with either the canvas scripting API or the WebGL API to draw graphics and animations.
254254
canvas HtmlCanvasElement [height, width] true,
255255
/// The `<caption>` HTML element specifies the caption (or title) of a table.

0 commit comments

Comments
 (0)