Skip to content

Commit

Permalink
Enable custom classnames on <CustomSelectControl> options (#23045)
Browse files Browse the repository at this point in the history
* Adds custom classname to dropdown options

* Updates story with new custom classname prop
  • Loading branch information
getdave authored Jun 10, 2020
1 parent e9e3027 commit cd9bceb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/components/src/custom-select-control/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ The label for the control.
#### options

The options that can be chosen from.
- Type: `Array<{ key: String, name: String, style: ?{}, ...rest }>`
- Type: `Array<{ key: String, name: String, style: ?{}, className: ?String, ...rest }>`
- Required: Yes

#### onChange
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/custom-select-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ export default function CustomSelectControl( {
index,
key: item.key,
className: classnames(
item.className,
'components-custom-select-control__item',
{
'is-highlighted':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const defaultOptions = [
key: 'normal',
name: 'Normal',
style: { fontSize: '100%' },
className: 'can-apply-custom-class-to-option',
},
{
key: 'large',
Expand Down

0 comments on commit cd9bceb

Please sign in to comment.