diff --git a/src/components/EntryEditor/EntryEditor.js b/src/components/EntryEditor/EntryEditor.js index 6895eb04..47b3c035 100644 --- a/src/components/EntryEditor/EntryEditor.js +++ b/src/components/EntryEditor/EntryEditor.js @@ -68,7 +68,10 @@ class EntryEditor extends Component { ); const editor = ( - + this.updateStickyContext = fn} + > { collectionPreviewEnabled ? togglePreviewButton : null } {editor}
diff --git a/src/components/UI/Sticky/Sticky.css b/src/components/UI/Sticky/Sticky.css index 37259174..f3da5abd 100644 --- a/src/components/UI/Sticky/Sticky.css +++ b/src/components/UI/Sticky/Sticky.css @@ -3,7 +3,7 @@ } .sticky { - position: relative !important; + width: 100%; } .stickyActive:not(.stickyAtBottom) { diff --git a/src/components/UI/Sticky/Sticky.js b/src/components/UI/Sticky/Sticky.js index b6d2d86d..361a0b3a 100644 --- a/src/components/UI/Sticky/Sticky.js +++ b/src/components/UI/Sticky/Sticky.js @@ -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}