Skip to content
Snippets Groups Projects
Commit 2baa28a9 authored by chris's avatar chris
Browse files

tags fix

parent fb9962b1
No related branches found
No related tags found
1 merge request!287tags fix
......@@ -132,10 +132,6 @@ const CustomTagBlockComponent = ({ isShowTag, item }) => {
}
};
const onSelectTag = val => {
item.run(state, dispatch, val.replace(/ /g, '-').toLowerCase());
};
const renderTagList = () => {
const tagList = [];
const blockTags = allTags.filter(tag => {
......@@ -147,11 +143,13 @@ const CustomTagBlockComponent = ({ isShowTag, item }) => {
<TagBoxWrapper key={uuidv4()}>
<Box key={uuidv4()} />
<StyledButton
active={JSON.parse(tagStatus[blockTag.label])}
active={tagStatus[blockTag.label]}
disabled={isDisabled}
key={uuidv4()}
label={blockTag.label}
onMouseDown={() => onSelectTag(blockTag.label)}
onMouseDown={() => {
item.run(activeView.state, activeView.dispatch, blockTag.label);
}}
title={blockTag.label}
/>
</TagBoxWrapper>,
......
......@@ -8,7 +8,7 @@ class CustomTagBlockTool extends Tools {
get run() {
return (state, dispatch, val) => {
Commands.setBlockType(state.config.schema.nodes.customTagBlock, {
class: val,
class: val.replace(/ /g, '-').toLowerCase(),
})(state, dispatch);
};
}
......
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