Skip to content

Commit b75bd2f

Browse files
asyncLizcopybara-github
authored andcommitted
docs: button and icon button says "text" instead of "button" for type
Fixes #5650 PiperOrigin-RevId: 645142410
1 parent 46d66ed commit b75bd2f

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
lines changed

button/internal/button.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export abstract class Button extends buttonBaseClass implements FormSubmitter {
7979
false;
8080

8181
/**
82-
* The default behavior of the button. May be "text", "reset", or "submit"
82+
* The default behavior of the button. May be "button", "reset", or "submit"
8383
* (default).
8484
*/
8585
@property() type: FormSubmitterType = 'submit';
@@ -135,7 +135,10 @@ export abstract class Button extends buttonBaseClass implements FormSubmitter {
135135
${this.renderElevationOrOutline?.()}
136136
<div class="background"></div>
137137
<md-focus-ring part="focus-ring" for=${buttonId}></md-focus-ring>
138-
<md-ripple part="ripple" for=${buttonId} ?disabled="${isDisabled}"></md-ripple>
138+
<md-ripple
139+
part="ripple"
140+
for=${buttonId}
141+
?disabled="${isDisabled}"></md-ripple>
139142
${buttonOrLink}
140143
`;
141144
}

docs/components/button.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ Token | Default value
717717
| `target` | `target` | `string` | `''` | Where to display the linked `href` URL for a link button. Common options include `_blank` to open in a new tab. |
718718
| `trailingIcon` | `trailing-icon` | `boolean` | `false` | Whether to render the icon at the inline end of the label rather than the inline start.<br>_Note:_ Link buttons cannot have trailing icons. |
719719
| `hasIcon` | `has-icon` | `boolean` | `false` | Whether to display the icon or not. |
720-
| `type` | `type` | `string` | `'submit'` | The default behavior of the button. May be "text", "reset", or "submit" (default). |
720+
| `type` | `type` | `string` | `'submit'` | The default behavior of the button. May be "button", "reset", or "submit" (default). |
721721
| `value` | `value` | `string` | `''` | The value added to a form with the button's name when the button submits a form. |
722722
| `name` | | `string` | `undefined` | |
723723
| `form` | | `HTMLFormElement` | `undefined` | |
@@ -737,7 +737,7 @@ Token | Default value
737737
| `target` | `target` | `string` | `''` | Where to display the linked `href` URL for a link button. Common options include `_blank` to open in a new tab. |
738738
| `trailingIcon` | `trailing-icon` | `boolean` | `false` | Whether to render the icon at the inline end of the label rather than the inline start.<br>_Note:_ Link buttons cannot have trailing icons. |
739739
| `hasIcon` | `has-icon` | `boolean` | `false` | Whether to display the icon or not. |
740-
| `type` | `type` | `string` | `'submit'` | The default behavior of the button. May be "text", "reset", or "submit" (default). |
740+
| `type` | `type` | `string` | `'submit'` | The default behavior of the button. May be "button", "reset", or "submit" (default). |
741741
| `value` | `value` | `string` | `''` | The value added to a form with the button's name when the button submits a form. |
742742
| `name` | | `string` | `undefined` | |
743743
| `form` | | `HTMLFormElement` | `undefined` | |
@@ -757,7 +757,7 @@ Token | Default value
757757
| `target` | `target` | `string` | `''` | Where to display the linked `href` URL for a link button. Common options include `_blank` to open in a new tab. |
758758
| `trailingIcon` | `trailing-icon` | `boolean` | `false` | Whether to render the icon at the inline end of the label rather than the inline start.<br>_Note:_ Link buttons cannot have trailing icons. |
759759
| `hasIcon` | `has-icon` | `boolean` | `false` | Whether to display the icon or not. |
760-
| `type` | `type` | `string` | `'submit'` | The default behavior of the button. May be "text", "reset", or "submit" (default). |
760+
| `type` | `type` | `string` | `'submit'` | The default behavior of the button. May be "button", "reset", or "submit" (default). |
761761
| `value` | `value` | `string` | `''` | The value added to a form with the button's name when the button submits a form. |
762762
| `name` | | `string` | `undefined` | |
763763
| `form` | | `HTMLFormElement` | `undefined` | |
@@ -777,7 +777,7 @@ Token | Default value
777777
| `target` | `target` | `string` | `''` | Where to display the linked `href` URL for a link button. Common options include `_blank` to open in a new tab. |
778778
| `trailingIcon` | `trailing-icon` | `boolean` | `false` | Whether to render the icon at the inline end of the label rather than the inline start.<br>_Note:_ Link buttons cannot have trailing icons. |
779779
| `hasIcon` | `has-icon` | `boolean` | `false` | Whether to display the icon or not. |
780-
| `type` | `type` | `string` | `'submit'` | The default behavior of the button. May be "text", "reset", or "submit" (default). |
780+
| `type` | `type` | `string` | `'submit'` | The default behavior of the button. May be "button", "reset", or "submit" (default). |
781781
| `value` | `value` | `string` | `''` | The value added to a form with the button's name when the button submits a form. |
782782
| `name` | | `string` | `undefined` | |
783783
| `form` | | `HTMLFormElement` | `undefined` | |
@@ -797,7 +797,7 @@ Token | Default value
797797
| `target` | `target` | `string` | `''` | Where to display the linked `href` URL for a link button. Common options include `_blank` to open in a new tab. |
798798
| `trailingIcon` | `trailing-icon` | `boolean` | `false` | Whether to render the icon at the inline end of the label rather than the inline start.<br>_Note:_ Link buttons cannot have trailing icons. |
799799
| `hasIcon` | `has-icon` | `boolean` | `false` | Whether to display the icon or not. |
800-
| `type` | `type` | `string` | `'submit'` | The default behavior of the button. May be "text", "reset", or "submit" (default). |
800+
| `type` | `type` | `string` | `'submit'` | The default behavior of the button. May be "button", "reset", or "submit" (default). |
801801
| `value` | `value` | `string` | `''` | The value added to a form with the button's name when the button submits a form. |
802802
| `name` | | `string` | `undefined` | |
803803
| `form` | | `HTMLFormElement` | `undefined` | |

docs/components/icon-button.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ Token | Default value
444444
| `ariaLabelSelected` | `aria-label-selected` | `string` | `''` | The `aria-label` of the button when the button is toggleable and selected. |
445445
| `toggle` | `toggle` | `boolean` | `false` | When true, the button will toggle between selected and unselected states |
446446
| `selected` | `selected` | `boolean` | `false` | Sets the selected state. When false, displays the default icon. When true, displays the selected icon, or the default icon If no `slot="selected"` icon is provided. |
447-
| `type` | `type` | `string` | `'submit'` | The default behavior of the button. May be "text", "reset", or "submit" (default). |
447+
| `type` | `type` | `string` | `'submit'` | The default behavior of the button. May be "button", "reset", or "submit" (default). |
448448
| `value` | `value` | `string` | `''` | The value added to a form with the button's name when the button submits a form. |
449449
| `name` | | `string` | `undefined` | |
450450
| `form` | | `HTMLFormElement` | `undefined` | |
@@ -478,7 +478,7 @@ Token | Default value
478478
| `ariaLabelSelected` | `aria-label-selected` | `string` | `''` | The `aria-label` of the button when the button is toggleable and selected. |
479479
| `toggle` | `toggle` | `boolean` | `false` | When true, the button will toggle between selected and unselected states |
480480
| `selected` | `selected` | `boolean` | `false` | Sets the selected state. When false, displays the default icon. When true, displays the selected icon, or the default icon If no `slot="selected"` icon is provided. |
481-
| `type` | `type` | `string` | `'submit'` | The default behavior of the button. May be "text", "reset", or "submit" (default). |
481+
| `type` | `type` | `string` | `'submit'` | The default behavior of the button. May be "button", "reset", or "submit" (default). |
482482
| `value` | `value` | `string` | `''` | The value added to a form with the button's name when the button submits a form. |
483483
| `name` | | `string` | `undefined` | |
484484
| `form` | | `HTMLFormElement` | `undefined` | |
@@ -512,7 +512,7 @@ Token | Default value
512512
| `ariaLabelSelected` | `aria-label-selected` | `string` | `''` | The `aria-label` of the button when the button is toggleable and selected. |
513513
| `toggle` | `toggle` | `boolean` | `false` | When true, the button will toggle between selected and unselected states |
514514
| `selected` | `selected` | `boolean` | `false` | Sets the selected state. When false, displays the default icon. When true, displays the selected icon, or the default icon If no `slot="selected"` icon is provided. |
515-
| `type` | `type` | `string` | `'submit'` | The default behavior of the button. May be "text", "reset", or "submit" (default). |
515+
| `type` | `type` | `string` | `'submit'` | The default behavior of the button. May be "button", "reset", or "submit" (default). |
516516
| `value` | `value` | `string` | `''` | The value added to a form with the button's name when the button submits a form. |
517517
| `name` | | `string` | `undefined` | |
518518
| `form` | | `HTMLFormElement` | `undefined` | |
@@ -546,7 +546,7 @@ Token | Default value
546546
| `ariaLabelSelected` | `aria-label-selected` | `string` | `''` | The `aria-label` of the button when the button is toggleable and selected. |
547547
| `toggle` | `toggle` | `boolean` | `false` | When true, the button will toggle between selected and unselected states |
548548
| `selected` | `selected` | `boolean` | `false` | Sets the selected state. When false, displays the default icon. When true, displays the selected icon, or the default icon If no `slot="selected"` icon is provided. |
549-
| `type` | `type` | `string` | `'submit'` | The default behavior of the button. May be "text", "reset", or "submit" (default). |
549+
| `type` | `type` | `string` | `'submit'` | The default behavior of the button. May be "button", "reset", or "submit" (default). |
550550
| `value` | `value` | `string` | `''` | The value added to a form with the button's name when the button submits a form. |
551551
| `name` | | `string` | `undefined` | |
552552
| `form` | | `HTMLFormElement` | `undefined` | |

iconbutton/internal/icon-button.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export class IconButton extends iconButtonBaseClass implements FormSubmitter {
9292
@property({type: Boolean, reflect: true}) selected = false;
9393

9494
/**
95-
* The default behavior of the button. May be "text", "reset", or "submit"
95+
* The default behavior of the button. May be "button", "reset", or "submit"
9696
* (default).
9797
*/
9898
@property() type: FormSubmitterType = 'submit';

0 commit comments

Comments
 (0)