Questions tagged [react-slate]
12 questions
11
votes
1 answer
TypeError: Text.isText is not a function
I'm following a slate tutorial on https://docs.slatejs.org/walkthroughs/04-applying-custom-formatting
There is a function call Text.isText(n), I keep getting Type:Error Text.isText is not a function
toggleBoldMark(editor) {
const isActive =…

gurpartap
- 375
- 2
- 9
5
votes
1 answer
get copied content inside onCopy hook (plugin)
I am trying to get copied fragment into onCopy hook vainly.
I've been trying with the event.clipboardData...
const { clipboardData } = event;
const encoded = clipboardData.getData("application/x-slate-fragment");
But it seems as empty. I have also…

Apeiron
- 1,881
- 2
- 13
- 21
4
votes
3 answers
Moving cursor in react slate-editor
I'm trying to move the cursor in react slate-editor.
I tried to do it in 2 ways.
First:
// This code saving key in offset in variables
const nativeSelection = this.getSelectedText();
const nativeRange = nativeSelection.getRangeAt(0);
const range…

ohadinho
- 6,894
- 16
- 71
- 124
2
votes
0 answers
How to get slate indentation with increasing depth
how to get numbered list when Tab key press on slate editor currently i get only one numbered list ?
export const toggleBlock = (editor, format) => {
const isActive = isBlockActive(editor, format);
const isList = LIST_TYPES.includes(format);
…

LOVENEET SINGH
- 193
- 2
- 9
2
votes
1 answer
Slate editor active state always false using isBlockActive from examples
I have created an editor from composing a couple of slates examples together, namely https://www.slatejs.org/examples/richtext and https://www.slatejs.org/examples/links
However when I added these the active state for all block level nodes it…

Joe Methven
- 518
- 4
- 15
0
votes
1 answer
How to insert gifs in slate editor
I have a slate text editor in my app and would like to insert gifs with the use of giphy links.
I'm attempting to add with the use of the insertNodes function but that seems to just add a new line. I've listed the function I'm using to add the gif…

Mr.Grease
- 197
- 1
- 13
0
votes
0 answers
Next.js: slate-react - Warning: Prop `data-slate-editor-id` did not match
I created a Rich Text Editor in React using Slate.js and slate-react. It has edit and read mode. When in read mode, I am using Next.js SSR & I'm getting a warning.

Dimitar Ivanov
- 1
- 1
0
votes
1 answer
Create a temporary visual effect when insertNode on on react-slate
I allow our users to select snippets of text to insert into the Slate editor from a list of text items. To do so I use Transforms.insertNodes(editor, texts) which works perfectly.
The insertion can be abrupt though, from a UX perspective. Especially…

Sean
- 2,412
- 3
- 25
- 31
0
votes
0 answers
Merge each person's states in react-slate
I am building a doc editor like google doc using react-slate for the frontend and express for the backend. It works well when one person types in the editor but I faced one problem when some people typed in one editor. When two people or some people…

Intelliseawolf
- 1
- 1
0
votes
1 answer
Is there a way to trigger an event when you backspace and delete an image using slate.js?
I am using slate.js and when I delete an image by pressing backspace the image is removed from state and no longer exists. However, with the image still being stored on the server. I would like to trigger an event to delete the image from the…

coder5666666666
- 37
- 5
0
votes
1 answer
Error: Editor' is not exported from 'slate-react'
I'm trying to build simple slate editor in React.
I'm using create-react-app and I have made simple component for representing the editor
import React, { useState } from "react";
import { Editor } from "slate-react";
import { Value } from…

HardRock
- 809
- 2
- 12
- 37
0
votes
1 answer
Problem to add a new block right after the current one
I'm trying to add a new block right after the block where the cursor is located / where I click on a button.
My questions are:
How can I determine the path for the current block?
Which method can I use to add a block after? I use insertNode but you…

Thierry Templier
- 198,364
- 44
- 396
- 360