From ad47392c1333537ed3e36454a688a74284da9d5e Mon Sep 17 00:00:00 2001 From: Rainer Simon Date: Sun, 4 Apr 2021 09:12:02 +0200 Subject: [PATCH] Closes #54 --- src/editor/Editor.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/editor/Editor.jsx b/src/editor/Editor.jsx index 840b6a6..7c48efe 100644 --- a/src/editor/Editor.jsx +++ b/src/editor/Editor.jsx @@ -158,7 +158,8 @@ const Editor = props => { }) : false; const hasDelete = currentAnnotation && - currentAnnotation.bodies.length > 0 && // annotation has bodies, + // annotation has bodies or allowEmpty, + (currentAnnotation.bodies.length > 0 || props.config.allowEmpty) && !props.readOnly && // we are not in read-only config, !currentAnnotation.isSelection && // this is not a selection, and !widgets.some(isReadOnlyWidget); // every widget is deletable