fix: Unintended scroll reset when switching between view / edit (#1807)

* fix: Don't remount document when switching between edit/read-only
fix: Button vertical alignment when using as=Link

* fix: Bump RME, fixes issue with image behavior changing between read-only/edit without editor remount

* fix: Heading anchor positioning
This commit is contained in:
Tom Moor
2021-01-14 19:50:10 -08:00
committed by GitHub
parent 68a65be135
commit c8d305aeca
7 changed files with 25 additions and 33 deletions

View File

@@ -81,13 +81,13 @@ class DocumentScene extends React.Component<Props> {
@observable title: string = this.props.document.title;
getEditorText: () => string = () => this.props.document.text;
componentDidMount() {
this.updateIsDirty();
}
componentDidUpdate(prevProps) {
const { auth, document } = this.props;
if (prevProps.readOnly && !this.props.readOnly) {
this.updateIsDirty();
}
if (this.props.readOnly) {
this.lastRevision = document.revision;
@@ -440,7 +440,7 @@ class DocumentScene extends React.Component<Props> {
ui={this.props.ui}
/>
</Flex>
{readOnly && !isShare && !revision && (
{!isShare && !revision && (
<>
<MarkAsViewed document={document} />
<ReferencesWrapper isOnlyTitle={document.isOnlyTitle}>