From 7f0612c174f983697a72e0121983676f01124d3c Mon Sep 17 00:00:00 2001 From: e11sy <130844513+e11sy@users.noreply.github.com> Date: Wed, 30 Oct 2024 17:06:51 +0300 Subject: [PATCH] fix removeChildWrapperIfEmpty behaviour --- src/utils/removeChildWrapperIfEmpty.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/utils/removeChildWrapperIfEmpty.ts b/src/utils/removeChildWrapperIfEmpty.ts index d7e354fc..f0e6e9a9 100644 --- a/src/utils/removeChildWrapperIfEmpty.ts +++ b/src/utils/removeChildWrapperIfEmpty.ts @@ -6,7 +6,10 @@ import { getChildItems } from './getChildItems'; * @param childWrapper - childWrapper to be removed if it is empty */ export function removeChildWrapperIfEmpty(childWrapper: ItemChildWrapperElement): void { - if (getChildItems(childWrapper) === null) { + /** + * Check that there is at least one item + */ + if (getChildItems(childWrapper).length === 0) { childWrapper.remove(); } }