Skip to content

Commit 58c4171

Browse files
committed
Don't focus editor in readonly mode
1 parent 60e4cbc commit 58c4171

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/components/EditorTextArea.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,14 @@ export default function EditorTextArea({
124124

125125
resetFunctionRef.current = () => {
126126
editor.setValue('');
127-
editor.focus();
127+
if (!readOnly) {
128+
editor.focus();
129+
}
128130
};
129131

130-
editor.focus();
132+
if (!readOnly) {
133+
editor.focus();
134+
}
131135
};
132136

133137
const onChange: OnChange = useCallback(

0 commit comments

Comments
 (0)