Skip to content

Commit

Permalink
Add popoverProps property to DropDown component (#14867)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgefilipecosta authored and draganescu committed Jun 18, 2019
1 parent 8f8776f commit 3c153f1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/components/CHANGELOG.md
@@ -1,3 +1,10 @@
## Next release

### New Features

- Added a new `popoverProps` prop to the `Dropdown` component which allows users of the `Dropdown` component to pass props directly to the `PopOver` component.


## 8.0.0 (2019-06-12)

### New Feature
Expand Down
8 changes: 8 additions & 0 deletions packages/components/src/dropdown/README.md
Expand Up @@ -100,3 +100,11 @@ Opt-in prop to show popovers fullscreen on mobile, pass `false` in this prop to
- Type: `String` or `Boolean`
- Required: No
- Default: `"firstElement"`

### popoverProps

Properties of popoverProps object will be passed as props to the `Popover` component.
Use this o object to access properties/feature if the `Popover` component that are not already exposed in the `Dropdown`component, e.g.: the hability to have the popover without an arrow.

- Type: `Object`
- Required: No
2 changes: 2 additions & 0 deletions packages/components/src/dropdown/index.js
Expand Up @@ -74,6 +74,7 @@ class Dropdown extends Component {
expandOnMobile,
headerTitle,
focusOnMount,
popoverProps,
} = this.props;

const args = { isOpen, onToggle: this.toggle, onClose: this.close };
Expand All @@ -90,6 +91,7 @@ class Dropdown extends Component {
expandOnMobile={ expandOnMobile }
headerTitle={ headerTitle }
focusOnMount={ focusOnMount }
{ ...popoverProps }
>
{ renderContent( args ) }
</Popover>
Expand Down

0 comments on commit 3c153f1

Please sign in to comment.