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

back space fix

parent e5ea7d8e
No related branches found
No related tags found
1 merge request!190Find and replace
......@@ -7,12 +7,14 @@ import React, {
useCallback,
useEffect,
} from 'react';
import { debounce } from 'lodash';
import { debounce, each } from 'lodash';
import styled from 'styled-components';
import { grid, th } from '@pubsweet/ui-toolkit';
import { WaxContext } from 'wax-prosemirror-core';
import Icon from '../../helpers/Icon';
import { selectParentNode } from 'prosemirror-commands';
const Wrapper = styled.div`
width: 400px;
background: ${th('colorBackgroundHue')};
......@@ -75,8 +77,10 @@ const FindComponent = ({ close, expand, setPreviousSearcValue }) => {
const {
app,
view: { main },
view,
} = useContext(WaxContext);
console.log(view);
const {
state: { doc, tr },
} = main;
......@@ -106,6 +110,10 @@ const FindComponent = ({ close, expand, setPreviousSearcValue }) => {
const mergedTextNodes = [];
let index = 0;
each(view, (singleView, viewId) => {
// console.log(singleView, viewId);
});
doc.descendants((node, pos) => {
if (node.isText) {
if (mergedTextNodes[index]) {
......
......@@ -51,12 +51,11 @@ const backSpaceShortCut = (state, dispatch, view) => {
}
});
backSpace(
return backSpace(
state,
tr => dispatch(tr.setMeta('inputType', 'backwardsDelete')),
view,
);
return true;
};
const undoShortCut = (state, dispatch, view) =>
......
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