From eee81bb5854f4aded3d44ce5a80574fb92fbcffe Mon Sep 17 00:00:00 2001 From: Samuel Gratzl Date: Sun, 8 May 2022 10:20:41 +0200 Subject: [PATCH] feat: handle null selection --- js/model.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/model.ts b/js/model.ts index ef27152..1347c78 100644 --- a/js/model.ts +++ b/js/model.ts @@ -167,7 +167,9 @@ export function fixProps(context: RenderContext, delta: any, append = false) { } } } - if (typeof delta.selection === 'string' || Array.isArray(delta.selection)) { + if (typeof delta.selection === null || delta.selection === '') { + context.props.selection = null; + } else if (typeof delta.selection === 'string' || Array.isArray(delta.selection)) { context.props.selection = resolveSet( delta.selection, context.props.sets,