diff --git a/wax-prosemirror-components/src/components/customtag/CustomTagBlockComponent.js b/wax-prosemirror-components/src/components/customtag/CustomTagBlockComponent.js index ecdb3778fdc86bdd53738c280e5c6e8751d45110..0007779bd992404b7a0997d01283af3ce20d265e 100644 --- a/wax-prosemirror-components/src/components/customtag/CustomTagBlockComponent.js +++ b/wax-prosemirror-components/src/components/customtag/CustomTagBlockComponent.js @@ -133,7 +133,7 @@ const CustomTagBlockComponent = ({ isShowTag, item }) => { }; const onSelectTag = val => { - item.run(state, dispatch, val.replace(/ /g, '-')); + item.run(state, dispatch, val.replace(/ /g, '-').toLowerCase()); }; const renderTagList = () => { @@ -147,7 +147,7 @@ const CustomTagBlockComponent = ({ isShowTag, item }) => { <TagBoxWrapper key={uuidv4()}> <Box key={uuidv4()} /> <StyledButton - active={tagStatus[blockTag.label]} + active={JSON.parse(tagStatus[blockTag.label])} disabled={isDisabled} key={uuidv4()} label={blockTag.label} diff --git a/wax-prosemirror-components/src/components/customtag/CustomTagInlineOverlayCompoment.js b/wax-prosemirror-components/src/components/customtag/CustomTagInlineOverlayCompoment.js index aae723d7255e4bd21c0a208cf3f24fe61a996a46..8b0190dd5f25c3bfc795ec1d99b6e027e397666d 100644 --- a/wax-prosemirror-components/src/components/customtag/CustomTagInlineOverlayCompoment.js +++ b/wax-prosemirror-components/src/components/customtag/CustomTagInlineOverlayCompoment.js @@ -149,7 +149,7 @@ const CustomTagInlineOverlayComponent = ({ mark, setPosition, position }) => { state.schema.marks.customTagInline.create({ ...((mark && mark.attrs) || {}), tags, - class: tags.toString().replace(/ /g, '-'), + class: tags.toString().replace(/ /g, '-').toLowerCase(), }), ), ); @@ -176,7 +176,7 @@ const CustomTagInlineOverlayComponent = ({ mark, setPosition, position }) => { state.schema.marks.customTagInline.create({ ...((mark && mark.attrs) || {}), tags, - class: tags.toString().replace(/ /g, '-'), + class: tags.toString().replace(/ /g, '-').toLowerCase(), }), ), ); diff --git a/wax-prosemirror-services/src/CustomTagService/CustomTagBlockService/CustomTagBlockTool.js b/wax-prosemirror-services/src/CustomTagService/CustomTagBlockService/CustomTagBlockTool.js index c53581338180e48704deb6093f4b77bace1cae38..1b76fbe62e8334627e199e12897a5dc45ecfa1aa 100644 --- a/wax-prosemirror-services/src/CustomTagService/CustomTagBlockService/CustomTagBlockTool.js +++ b/wax-prosemirror-services/src/CustomTagService/CustomTagBlockService/CustomTagBlockTool.js @@ -26,7 +26,10 @@ class CustomTagBlockTool extends Tools { const tagsActive = {}; blockTags.forEach(tag => { - if (isActive && className === tag.label.replace(/ /g, '-')) { + if ( + isActive && + className === tag.label.replace(/ /g, '-').toLowerCase() + ) { tagsActive[tag.label] = true; } else { tagsActive[tag.label] = false;