From 7f91d0b557cfcdc2a07ec9b283b50741762448b9 Mon Sep 17 00:00:00 2001 From: Irwan Fario Subastian Date: Mon, 11 Jun 2018 09:59:16 +1000 Subject: [PATCH] Inline Void block cursor (#1886) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add contentEditable=false to void block wrapper * put contentEditable fals on inline void fix from https://github.com/ianstormtaylor/slate/pull/1734 works for block but inline void have a cursor which shouldn’t be there as typing inside inline void won’t work. so only removing contentEditable on blocks but not inline * update test --- packages/slate-react/src/components/void.js | 6 +++++- .../test/rendering/fixtures/custom-inline-void.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/slate-react/src/components/void.js b/packages/slate-react/src/components/void.js index 867681297..081fdda05 100644 --- a/packages/slate-react/src/components/void.js +++ b/packages/slate-react/src/components/void.js @@ -79,7 +79,11 @@ class Void extends React.Component { this.debug('render', { props }) return ( - + {readOnly ? null : spacer} {content} diff --git a/packages/slate-react/test/rendering/fixtures/custom-inline-void.js b/packages/slate-react/test/rendering/fixtures/custom-inline-void.js index 5e6f0c8b4..6a9e568f8 100644 --- a/packages/slate-react/test/rendering/fixtures/custom-inline-void.js +++ b/packages/slate-react/test/rendering/fixtures/custom-inline-void.js @@ -36,7 +36,7 @@ export const output = ` - +