From f01d641e4b395edad8e2620ea63ccba656812def Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Mon, 5 Nov 2018 23:50:28 +0100 Subject: [PATCH] fix active check for ordered list, fix #78 --- packages/tiptap-utils/src/utils/nodeIsActive.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/tiptap-utils/src/utils/nodeIsActive.js b/packages/tiptap-utils/src/utils/nodeIsActive.js index 1ebcdd409..a7d5c8d54 100644 --- a/packages/tiptap-utils/src/utils/nodeIsActive.js +++ b/packages/tiptap-utils/src/utils/nodeIsActive.js @@ -1,10 +1,10 @@ import { findParentNode } from 'prosemirror-utils' -export default function (state, type, attrs) { +export default function (state, type, attrs = {}) { const predicate = node => node.type === type const parent = findParentNode(predicate)(state.selection) - if (attrs === {} || !parent) { + if (!Object.keys(attrs).length || !parent) { return !!parent }