From acb42fac47544c350f05a92db8b6fc428141b7c4 Mon Sep 17 00:00:00 2001 From: Danilo Ercoli Date: Sat, 26 Jan 2019 12:14:30 +0100 Subject: [PATCH] [RMmobile] Add Enter.key detection to the Title block (#13500) * Intercept Enter.key and give the ability to add a new block after * Remove the custom mobile code, and use the default web implementation --- .../editor/src/components/post-title/index.native.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/editor/src/components/post-title/index.native.js b/packages/editor/src/components/post-title/index.native.js index 61148e0f4e7a68..1ce2384db72ea6 100644 --- a/packages/editor/src/components/post-title/index.native.js +++ b/packages/editor/src/components/post-title/index.native.js @@ -55,8 +55,9 @@ class PostTitle extends Component { { const { + insertDefaultBlock, clearSelectedBlock, } = dispatch( 'core/editor' ); return { + onEnterPress() { + insertDefaultBlock( undefined, undefined, 0 ); + }, clearSelectedBlock, }; } );