From 94a2e453eb839152267aea4224f1319df681f310 Mon Sep 17 00:00:00 2001 From: dkkb <82504881+dkkb@users.noreply.github.com> Date: Sat, 13 Nov 2021 00:21:56 +0800 Subject: [PATCH] fix: fix issue where the title can be modified in read-only mode (#2761) The title can be changed (but not saved) when the document is in read only mode. --- app/components/ContentEditable.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/components/ContentEditable.js b/app/components/ContentEditable.js index afc21ccf..b9c38ca8 100644 --- a/app/components/ContentEditable.js +++ b/app/components/ContentEditable.js @@ -5,6 +5,7 @@ import styled from "styled-components"; type Props = {| disabled?: boolean, + readOnly?: boolean, onChange?: (text: string) => void, onBlur?: (event: SyntheticInputEvent<>) => void, onInput?: (event: SyntheticInputEvent<>) => void, @@ -33,6 +34,7 @@ function ContentEditable({ maxLength, autoFocus, placeholder, + readOnly, ...rest }: Props) { const ref = React.useRef(); @@ -72,7 +74,7 @@ function ContentEditable({ return (