diff --git a/src/utils/removeChildWrapperIfEmpty.ts b/src/utils/removeChildWrapperIfEmpty.ts index d7e354f..f0e6e9a 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(); } }