Skip to content

Commit

Permalink
Spread modifier styles inside _getPopperStyle and update example
Browse files Browse the repository at this point in the history
  • Loading branch information
Brent Ertz authored and Pairing committed Mar 9, 2017
1 parent be18bdc commit 943b525
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
15 changes: 15 additions & 0 deletions example/index.jsx
Expand Up @@ -42,6 +42,21 @@ class App extends Component {
Content Right
<Arrow/>
</Popper>
<Popper placement="top" modifiers={ {
customStyle: {
enabled: true,
'function': function(data) {
data.styles = {
...data.styles,
background: 'red',
};
return data
}.bind(this)
},
} }>
Custom Style
<Arrow/>
</Popper>
<Popper placement={placement}>
Dynamic Content
<Arrow/>
Expand Down
4 changes: 4 additions & 0 deletions example/main.scss
Expand Up @@ -10,6 +10,10 @@ html {
font-family: 'Lato', sans-serif;
}

select {
margin-bottom: 3rem;
}

.popper {
background: #222;
color: white;
Expand Down
2 changes: 2 additions & 0 deletions src/Popper.jsx
Expand Up @@ -139,8 +139,10 @@ class Popper extends Component {
left,
position,
} = this.state.data.offsets.popper
const styles = this.state.data.styles

return {
...styles,
position,
top: 0,
left: 0,
Expand Down

0 comments on commit 943b525

Please sign in to comment.