From 60bad34942da3d158ce0bf91246ed41f0f3e5665 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sun, 2 Jul 2017 23:18:38 -0700 Subject: [PATCH] Entering edit mode should focus editor. closes #97 --- frontend/components/Editor/Editor.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frontend/components/Editor/Editor.js b/frontend/components/Editor/Editor.js index 025e5a034..36a2374ae 100644 --- a/frontend/components/Editor/Editor.js +++ b/frontend/components/Editor/Editor.js @@ -61,6 +61,12 @@ type KeyData = { } } + componentDidUpdate(prevProps: Props) { + if (prevProps.readOnly && !this.props.readOnly) { + this.focusAtEnd(); + } + } + getChildContext() { return { starred: this.props.starred }; }