Skip to content

Commit

Permalink
Remove buttonProps. Add isSmall as default for CustomSelectControl.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Q committed Jan 13, 2020
1 parent 481b663 commit 6afa12b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
12 changes: 6 additions & 6 deletions packages/components/src/custom-select-control/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ Used to visually hide the label. It will always be visible to screen readers.
- Type: `Boolean`
- Required: No

#### isSmall

Renders the Select in a smaller size.
- Type: `Boolean`
- Required: No

#### label

The label for the control.
Expand All @@ -102,12 +108,6 @@ Function called with the control's internal state changes. The `selectedItem` pr
- Type: `Function`
- Required: No

#### selectButtonProps

Props to pass to the internally rendered `Button` component.
- Type: `Object`
- Required: No

#### value

Can be used to externally control the value of the control, like in the `MyControlledCustomSelectControl` example above.
Expand Down
6 changes: 3 additions & 3 deletions packages/components/src/custom-select-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default function CustomSelectControl( {
label,
options: items,
onChange: onSelectedItemChange,
selectButtonProps = {},
isSmall = true,
value: _selectedItem,
} ) {
const {
Expand Down Expand Up @@ -97,11 +97,11 @@ export default function CustomSelectControl( {
</label>
<Button
{ ...getToggleButtonProps( {
...selectButtonProps,
// This is needed because some speech recognition software don't support `aria-labelledby`.
'aria-label': label,
'aria-labelledby': undefined,
className: classnames( 'components-custom-select-control__button', selectButtonProps.className ),
className: 'components-custom-select-control__button',
isSmall,
} ) }
>
{ itemToString( selectedItem ) }
Expand Down
1 change: 0 additions & 1 deletion packages/components/src/font-size-picker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ export default function FontSizePicker( {
<div className="components-font-size-picker__controls">
{ fontSizes.length > 0 && (
<CustomSelectControl
selectButtonProps={ { isSmall: true } }
className={ 'components-font-size-picker__select' }
label={ __( 'Preset Size' ) }
options={ options }
Expand Down

0 comments on commit 6afa12b

Please sign in to comment.