diff --git a/wax-prosemirror-components/src/components/findAndReplace/FindComponent.js b/wax-prosemirror-components/src/components/findAndReplace/FindComponent.js index b78c59d6476852e0b6284e97ea2a6c519be00f22..42cc4ea108539f61d11979e5ff02032625de168b 100644 --- a/wax-prosemirror-components/src/components/findAndReplace/FindComponent.js +++ b/wax-prosemirror-components/src/components/findAndReplace/FindComponent.js @@ -177,7 +177,6 @@ const FindComponent = ({ close, expand, setPreviousSearcValue }) => { ); const resultsFrom = helpers.getResultsFrom(results); const notesIds = helpers.getNotesIds(view.main); - const found = helpers.getClosestMatch( lastSelection.from, resultsFrom[lastActiveViewId], diff --git a/wax-prosemirror-components/src/components/findAndReplace/helpers.js b/wax-prosemirror-components/src/components/findAndReplace/helpers.js index 451ffa1d7c97eec92c6d40826fb4e6aff4ab09db..2bc31ee51bf32e9d060bf4c5745e614838999911 100644 --- a/wax-prosemirror-components/src/components/findAndReplace/helpers.js +++ b/wax-prosemirror-components/src/components/findAndReplace/helpers.js @@ -120,7 +120,6 @@ const getClosestMatch = (selectionFrom, results, greater = true) => { }; const moveToMatch = (view, lastActiveViewId, results, position) => { - console.log(lastActiveViewId, results, position); const selectionFrom = new TextSelection( view[lastActiveViewId].state.doc.resolve( results[lastActiveViewId][position].from, diff --git a/wax-prosemirror-services/src/NoteService/Editor.js b/wax-prosemirror-services/src/NoteService/Editor.js index 77276a22b0b0edcaf3905682b113f9cc693b07eb..79d3f2766bd41c470d5e0454813b1c5ee9fb9875 100644 --- a/wax-prosemirror-services/src/NoteService/Editor.js +++ b/wax-prosemirror-services/src/NoteService/Editor.js @@ -18,7 +18,7 @@ export default ({ node, view }) => { const context = useContext(WaxContext); const noteId = node.attrs.id; let noteView; - + let clickInNote = false; // eslint-disable-next-line react/destructuring-assignment const isEditable = context.view.main.props.editable(editable => { return editable; @@ -38,7 +38,7 @@ export default ({ node, view }) => { handleDOMEvents: { mousedown: () => { context.updateView({}, noteId); - + clickInNote = true; // Kludge to prevent issues due to the fact that the whole // footnote is node-selected (and thus DOM-selected) when // the parent editor is focused. @@ -92,6 +92,8 @@ export default ({ node, view }) => { // TODO Remove timeout and use state to check if noteView has changed setTimeout(() => { + if (clickInNote) context.updateView({}, noteId); + clickInNote = false; if (noteView.state.selection.from !== noteView.state.selection.to) context.updateView({}, noteId); }, 20);