Skip to content

Commit

Permalink
refactor(toggle): make props.labelA and props.labelB optional (#9550)
Browse files Browse the repository at this point in the history
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
janhassel and kodiakhq[bot] authored Sep 2, 2021
1 parent 6b6933c commit 355088c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion packages/react/src/components/Toggle/migrate-to-11.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,6 @@
| `aria-label` | - | Removed. No longer required. If still passed, it will be emitted on the `<button>` element. |
| - | `hideLabel` | New. Visually hides the label above the toggle while keeping it available to screen readers. |
| `onChange` | - | Removed. Not available on `<button>` elements. |
| - | `onClick` | New. To substitute previous `props.onChange` |
| - | `onClick` | New. To substitute previous `props.onChange`. |
| `labelA` | `labelA` | Made optional. Default: "Off". |
| `labelB` | `labelB` | Made optional. Default: "On". |
4 changes: 2 additions & 2 deletions packages/react/src/components/Toggle/next/Toggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,12 @@ Toggle.propTypes = {
/**
* Specify the label for the "off" position
*/
labelA: PropTypes.node.isRequired,
labelA: PropTypes.node,

/**
* Specify the label for the "on" position
*/
labelB: PropTypes.node.isRequired,
labelB: PropTypes.node,

/**
* Provide the text that will be read by a screen reader when visiting this
Expand Down

0 comments on commit 355088c

Please sign in to comment.