fix sticky toolbar width

This commit is contained in:
Shawn Erquhart
2017-04-12 10:36:08 -04:00
parent a1a693051c
commit 5d839e8410
3 changed files with 12 additions and 3 deletions

View File

@ -3,7 +3,7 @@
}
.sticky {
position: relative !important;
width: 100%;
}
.stickyActive:not(.stickyAtBottom) {

View File

@ -34,6 +34,7 @@ export class StickyContext extends Component {
componentDidMount() {
this.updateStickies(this.ref);
this.props.registerListener(this.updateStickies.bind(this, this.ref));
}
handleScroll = (event) => {
@ -144,7 +145,11 @@ export class Sticky extends Component {
[styles.stickyAtBottom]: state.shouldStickAtBottom,
},
)}
style={props.fillContainerWidth && state.containerWidth ? { width: state.containerWidth } : null}
style={
props.fillContainerWidth && state.containerWidth && state.shouldStick ?
{ width: state.containerWidth } :
null
}
ref={(ref) => {this.ref = ref}}
>
{props.children}