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

fix props

parent 6ecdbb1a
No related branches found
No related tags found
1 merge request!177Fixes
......@@ -28,7 +28,7 @@ const Button = ({ view = {}, item }) => {
return (
<MenuButton
active={isActive}
active={isActive || false}
disabled={isDisabled}
iconName={icon}
label={label}
......
......@@ -2,9 +2,7 @@
/* eslint react/prop-types: 0 */
import React from 'react';
import { v4 as uuidv4 } from 'uuid';
import { map } from 'lodash';
import { ToolGroupComponent, ToolGroups } from 'wax-prosemirror-components';
const MainMenuBar = ({ items = [], view }) => {
return <>{map(items, item => item.renderTools(view))}</>;
......
import React from 'react';
import { injectable, inject } from 'inversify';
import { BlockLevelTools, Tabs, ToolGroups } from 'wax-prosemirror-components';
import ToolGroup from '../../lib/ToolGroup';
import { isEmpty } from 'lodash';
import styled from 'styled-components';
import { v4 as uuidv4 } from 'uuid';
import ToolGroup from '../../lib/ToolGroup';
const Empty = styled.div`
background: khaki;
......@@ -49,7 +50,7 @@ class DisplayText extends ToolGroup {
};
const tabList = [first, second];
return <Tabs tabList={tabList} />;
return <Tabs key={uuidv4()} tabList={tabList} />;
}
}
......
......@@ -33,9 +33,11 @@ const setBlockType = (nodeType, attrs = {}) => {
const markActive = type => state => {
const { from, $from, to, empty } = state.selection;
return empty
const mark = empty
? type.isInSet(state.storedMarks || $from.marks())
: state.doc.rangeHasMark(from, to, type);
if (mark) return true;
return false;
};
const blockActive = (nodeType, attrs = {}) => {
......
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