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

fix block dropdown readonly

parent ba9111d1
No related branches found
No related tags found
No related merge requests found
......@@ -37,7 +37,7 @@ const markActive = type => state => {
};
const blockActive = (nodeType, attrs = {}) => {
return (state, dispatch) => {
return state => {
const { from, to } = state.selection;
let isActive = false;
state.doc.nodesBetween(from, to, (node, pos) => {
......
......@@ -155,6 +155,7 @@ const findAllMarksWithSameId = (state, mark) => {
}
});
});
console.log(allMarksWithSameId);
return allMarksWithSameId;
};
......@@ -249,7 +250,7 @@ export const findMatches = (doc, searchValue, matchCase) => {
const mergedTextNodes = [];
let index = 0;
allNodes.forEach((node, i) => {
allNodes.forEach(node => {
if (node.node.isText) {
if (mergedTextNodes[index]) {
mergedTextNodes[index] = {
......
......@@ -46,6 +46,10 @@ const BlockDropDownComponent = ({ view, tools }) => {
} = context;
const [label, setLabel] = useState(null);
const isEditable = main.props.editable(editable => {
return editable;
});
const dropDownOptions = [
// { label: 'Title (H1)', value: '0', item: tools[0] },
// { label: 'author', value: '1', item: tools[1] },
......@@ -84,12 +88,12 @@ const BlockDropDownComponent = ({ view, tools }) => {
}}
options={dropDownOptions}
placeholder="Block Level"
select
select={isEditable}
value={label}
/>
</Wrapper>
),
[label],
[label, isEditable],
);
return MultipleDropDown;
......
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