Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

Commit

Permalink
Cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
tiberiuichim committed May 21, 2020
1 parent df49b45 commit c1aff38
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/TextBlock/TextBlockEdit.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useMemo } from 'react';
import { Range, Node, Editor } from 'slate';
import { Range, Node } from 'slate';
import SlateEditor from './../editor';
import { getDOMSelectionInfo } from './../editor/utils';
import { plaintext_serialize } from './../editor/render';
Expand Down Expand Up @@ -36,16 +36,11 @@ const TextBlockEdit = (props) => {
},

ArrowDown: ({ editor, event, selection }) => {
//const end = Editor.end(editor, editor.children);

// daca suntem pe ultimul block
// daca suntem pe ultimul copil din block
// daca suntem la capatul selectiei din acel block
if (Range.isCollapsed(editor.selection)) {
const anchor = editor.selection?.anchor || {};

// the last node in the editor
let n = Node.last(editor, []);
const n = Node.last(editor, []);

if (
Node.get(editor, anchor.path) === n[0] &&
Expand All @@ -57,7 +52,6 @@ const TextBlockEdit = (props) => {
},

Backspace: ({ editor, event, selection, onDeleteBlock, id, data }) => {
console.log('backspace event');
const { start, end } = selection;
const { value } = data;

Expand Down

0 comments on commit c1aff38

Please sign in to comment.