Skip to content
Snippets Groups Projects
Commit c0126fce authored by Christos's avatar Christos
Browse files

Merge branch 'fix-tags' into 'master'

fix custom tags active

See merge request !285
parents f709347d 85a5b18d
No related branches found
No related tags found
1 merge request!285fix custom tags active
......@@ -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}
......
......@@ -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(),
}),
),
);
......
......@@ -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;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment