diff --git a/src/App/docutils/ComponentPreview/index.js b/src/App/docutils/ComponentPreview/index.js index 3eafb06f0f..64f902680f 100644 --- a/src/App/docutils/ComponentPreview/index.js +++ b/src/App/docutils/ComponentPreview/index.js @@ -355,9 +355,12 @@ const ComponentPreview = ({ setExpandedPreview(state) { this.setState({ previewExpanded: state }); - state - ? document.body.classList.add("has-vscroll") - : document.body.classList.remove("has-vscroll"); + + if (state) { + document.body.dataset.previewExpandedHasVscroll = "true"; + } else { + delete document.body.dataset.previewExpandedHasVscroll; + } } render() { @@ -378,7 +381,7 @@ const ComponentPreview = ({ {this.props.showExpandPreview && (!this.state.previewExpanded ? ( ) : (