Skip to content

Commit 8f0c4f0

Browse files
TimFLTim Laubert
authored andcommitted
Fix editable property being forced to true (#2945)
Co-authored-by: Tim Laubert <tim.laubert@azurspace.com>
1 parent b743d6f commit 8f0c4f0

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

packages/lexical-react/src/LexicalComposer.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export function LexicalComposer({initialConfig, children}: Props): JSX.Element {
8989
useLayoutEffect(() => {
9090
const isEditable = initialConfig.editable;
9191
const [editor] = composerContext;
92-
editor.setEditable(isEditable || true);
92+
editor.setEditable(isEditable !== undefined ? isEditable : true);
9393

9494
// We only do this for init
9595
// eslint-disable-next-line react-hooks/exhaustive-deps

packages/lexical-website/docs/concepts/read-only.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ editor.setEditable(true);
4444
In order to find the current mode of the editor you can use:
4545

4646
```js
47-
const readOnly = editor.isEditable(); // Returns true or false
47+
const isEditable = editor.isEditable(); // Returns true or false
4848
```
4949

5050
You can also get notified when the editor's read only mode has changed:

packages/lexical/src/LexicalEditor.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ export function createEditor(editorConfig?: {
342342
...(config.nodes || []),
343343
];
344344
const onError = config.onError;
345-
const isEditable = config.editable || true;
345+
const isEditable = config.editable !== undefined ? config.editable : true;
346346
let registeredNodes;
347347

348348
if (editorConfig === undefined && activeEditor !== null) {

0 commit comments

Comments
 (0)