Skip to content

Commit

Permalink
docs: button and icon button says "text" instead of "button" for type
Browse files Browse the repository at this point in the history
Fixes #5650

PiperOrigin-RevId: 645142410
  • Loading branch information
asyncLiz authored and copybara-github committed Jun 20, 2024
1 parent 46d66ed commit b75bd2f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
7 changes: 5 additions & 2 deletions button/internal/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export abstract class Button extends buttonBaseClass implements FormSubmitter {
false;

/**
* The default behavior of the button. May be "text", "reset", or "submit"
* The default behavior of the button. May be "button", "reset", or "submit"
* (default).
*/
@property() type: FormSubmitterType = 'submit';
Expand Down Expand Up @@ -135,7 +135,10 @@ export abstract class Button extends buttonBaseClass implements FormSubmitter {
${this.renderElevationOrOutline?.()}
<div class="background"></div>
<md-focus-ring part="focus-ring" for=${buttonId}></md-focus-ring>
<md-ripple part="ripple" for=${buttonId} ?disabled="${isDisabled}"></md-ripple>
<md-ripple
part="ripple"
for=${buttonId}
?disabled="${isDisabled}"></md-ripple>
${buttonOrLink}
`;
}
Expand Down
10 changes: 5 additions & 5 deletions docs/components/button.md
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ Token | Default value
| `target` | `target` | `string` | `''` | Where to display the linked `href` URL for a link button. Common options include `_blank` to open in a new tab. |
| `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. |
| `hasIcon` | `has-icon` | `boolean` | `false` | Whether to display the icon or not. |
| `type` | `type` | `string` | `'submit'` | The default behavior of the button. May be "text", "reset", or "submit" (default). |
| `type` | `type` | `string` | `'submit'` | The default behavior of the button. May be "button", "reset", or "submit" (default). |
| `value` | `value` | `string` | `''` | The value added to a form with the button's name when the button submits a form. |
| `name` | | `string` | `undefined` | |
| `form` | | `HTMLFormElement` | `undefined` | |
Expand All @@ -737,7 +737,7 @@ Token | Default value
| `target` | `target` | `string` | `''` | Where to display the linked `href` URL for a link button. Common options include `_blank` to open in a new tab. |
| `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. |
| `hasIcon` | `has-icon` | `boolean` | `false` | Whether to display the icon or not. |
| `type` | `type` | `string` | `'submit'` | The default behavior of the button. May be "text", "reset", or "submit" (default). |
| `type` | `type` | `string` | `'submit'` | The default behavior of the button. May be "button", "reset", or "submit" (default). |
| `value` | `value` | `string` | `''` | The value added to a form with the button's name when the button submits a form. |
| `name` | | `string` | `undefined` | |
| `form` | | `HTMLFormElement` | `undefined` | |
Expand All @@ -757,7 +757,7 @@ Token | Default value
| `target` | `target` | `string` | `''` | Where to display the linked `href` URL for a link button. Common options include `_blank` to open in a new tab. |
| `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. |
| `hasIcon` | `has-icon` | `boolean` | `false` | Whether to display the icon or not. |
| `type` | `type` | `string` | `'submit'` | The default behavior of the button. May be "text", "reset", or "submit" (default). |
| `type` | `type` | `string` | `'submit'` | The default behavior of the button. May be "button", "reset", or "submit" (default). |
| `value` | `value` | `string` | `''` | The value added to a form with the button's name when the button submits a form. |
| `name` | | `string` | `undefined` | |
| `form` | | `HTMLFormElement` | `undefined` | |
Expand All @@ -777,7 +777,7 @@ Token | Default value
| `target` | `target` | `string` | `''` | Where to display the linked `href` URL for a link button. Common options include `_blank` to open in a new tab. |
| `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. |
| `hasIcon` | `has-icon` | `boolean` | `false` | Whether to display the icon or not. |
| `type` | `type` | `string` | `'submit'` | The default behavior of the button. May be "text", "reset", or "submit" (default). |
| `type` | `type` | `string` | `'submit'` | The default behavior of the button. May be "button", "reset", or "submit" (default). |
| `value` | `value` | `string` | `''` | The value added to a form with the button's name when the button submits a form. |
| `name` | | `string` | `undefined` | |
| `form` | | `HTMLFormElement` | `undefined` | |
Expand All @@ -797,7 +797,7 @@ Token | Default value
| `target` | `target` | `string` | `''` | Where to display the linked `href` URL for a link button. Common options include `_blank` to open in a new tab. |
| `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. |
| `hasIcon` | `has-icon` | `boolean` | `false` | Whether to display the icon or not. |
| `type` | `type` | `string` | `'submit'` | The default behavior of the button. May be "text", "reset", or "submit" (default). |
| `type` | `type` | `string` | `'submit'` | The default behavior of the button. May be "button", "reset", or "submit" (default). |
| `value` | `value` | `string` | `''` | The value added to a form with the button's name when the button submits a form. |
| `name` | | `string` | `undefined` | |
| `form` | | `HTMLFormElement` | `undefined` | |
Expand Down
8 changes: 4 additions & 4 deletions docs/components/icon-button.md
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ Token | Default value
| `ariaLabelSelected` | `aria-label-selected` | `string` | `''` | The `aria-label` of the button when the button is toggleable and selected. |
| `toggle` | `toggle` | `boolean` | `false` | When true, the button will toggle between selected and unselected states |
| `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. |
| `type` | `type` | `string` | `'submit'` | The default behavior of the button. May be "text", "reset", or "submit" (default). |
| `type` | `type` | `string` | `'submit'` | The default behavior of the button. May be "button", "reset", or "submit" (default). |
| `value` | `value` | `string` | `''` | The value added to a form with the button's name when the button submits a form. |
| `name` | | `string` | `undefined` | |
| `form` | | `HTMLFormElement` | `undefined` | |
Expand Down Expand Up @@ -478,7 +478,7 @@ Token | Default value
| `ariaLabelSelected` | `aria-label-selected` | `string` | `''` | The `aria-label` of the button when the button is toggleable and selected. |
| `toggle` | `toggle` | `boolean` | `false` | When true, the button will toggle between selected and unselected states |
| `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. |
| `type` | `type` | `string` | `'submit'` | The default behavior of the button. May be "text", "reset", or "submit" (default). |
| `type` | `type` | `string` | `'submit'` | The default behavior of the button. May be "button", "reset", or "submit" (default). |
| `value` | `value` | `string` | `''` | The value added to a form with the button's name when the button submits a form. |
| `name` | | `string` | `undefined` | |
| `form` | | `HTMLFormElement` | `undefined` | |
Expand Down Expand Up @@ -512,7 +512,7 @@ Token | Default value
| `ariaLabelSelected` | `aria-label-selected` | `string` | `''` | The `aria-label` of the button when the button is toggleable and selected. |
| `toggle` | `toggle` | `boolean` | `false` | When true, the button will toggle between selected and unselected states |
| `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. |
| `type` | `type` | `string` | `'submit'` | The default behavior of the button. May be "text", "reset", or "submit" (default). |
| `type` | `type` | `string` | `'submit'` | The default behavior of the button. May be "button", "reset", or "submit" (default). |
| `value` | `value` | `string` | `''` | The value added to a form with the button's name when the button submits a form. |
| `name` | | `string` | `undefined` | |
| `form` | | `HTMLFormElement` | `undefined` | |
Expand Down Expand Up @@ -546,7 +546,7 @@ Token | Default value
| `ariaLabelSelected` | `aria-label-selected` | `string` | `''` | The `aria-label` of the button when the button is toggleable and selected. |
| `toggle` | `toggle` | `boolean` | `false` | When true, the button will toggle between selected and unselected states |
| `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. |
| `type` | `type` | `string` | `'submit'` | The default behavior of the button. May be "text", "reset", or "submit" (default). |
| `type` | `type` | `string` | `'submit'` | The default behavior of the button. May be "button", "reset", or "submit" (default). |
| `value` | `value` | `string` | `''` | The value added to a form with the button's name when the button submits a form. |
| `name` | | `string` | `undefined` | |
| `form` | | `HTMLFormElement` | `undefined` | |
Expand Down
2 changes: 1 addition & 1 deletion iconbutton/internal/icon-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export class IconButton extends iconButtonBaseClass implements FormSubmitter {
@property({type: Boolean, reflect: true}) selected = false;

/**
* The default behavior of the button. May be "text", "reset", or "submit"
* The default behavior of the button. May be "button", "reset", or "submit"
* (default).
*/
@property() type: FormSubmitterType = 'submit';
Expand Down

0 comments on commit b75bd2f

Please sign in to comment.