From c7409e899a2166d25df8d50872afde156299e726 Mon Sep 17 00:00:00 2001 From: Jake Donham Date: Tue, 19 Oct 2021 13:04:03 -0700 Subject: [PATCH] fix bug due to https://github.com/ianstormtaylor/slate/pull/4540 --- script.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/script.js b/script.js index bb78e5e..164ccac 100644 --- a/script.js +++ b/script.js @@ -469,7 +469,10 @@ const App = () => { const setInputAndSlateValue = React.useCallback(input => { setInputValue(input); try { - setSlateValue(xmlToSlate(input).children); + const children = xmlToSlate(input).children; + setSlateValue(children); + inputEditor.children = children; + inputEditor.onChange(); } catch (e) { // TODO(jaked) report this error somehow? // lots of transient errors while editing