All Questions
Tagged with slate-react or react-slate
19 questions
1
vote
1
answer
219
views
Slate.js - trying and failing to update the text of a custom node using Transforms.setNodes
For example, I will have an editor.children layout like so:
[
{
type: 'paragraph',
children: [
{
text: 'A line of text!',
},
],
},
{
...
1
vote
1
answer
2k
views
PlateJS Serializing HTML
I'm trying to make it so that when I click on a button, I can get an html string.
Generally, this rich text editor will be inside the React-Hook-Form and when the form is submitted, it will save the ...
2
votes
0
answers
111
views
Convert value of old format to new format, react slate
I am migrating to newer version of react slate editor. But the data format of the new version is different than old one(0.47.x). Is there any function given by slate-react or slate itself for the ...
-1
votes
1
answer
91
views
TS error when passing myDecorator function as decorate prop to React Slate
I am getting the following TS error:
(property) decorate?: ((entry: NodeEntry<Node>) => BaseRange[]) | undefined
Type '([node, path]: [node: any, path: any]) => { anchor: { path: any; ...
1
vote
1
answer
681
views
ctrl + z, ctrl + y not working in slate.js editor
ctrl z not working in my slateJs editor, but it is working fine in slate example
<Slate editor={editor} value={initialValue}>
<Editable
renderElement={renderElement}
...
0
votes
1
answer
693
views
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 ...
1
vote
0
answers
510
views
Slate js path is null error when pasting html
I have upgraded my slate version to 0.66.5 and slate-react to 0.68.0 but now I am ruuning into the following issue:
This issue occurs when I paste html content from third party sources.
Snippets of ...
0
votes
1
answer
914
views
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 ...
4
votes
3
answers
6k
views
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 ...
3
votes
1
answer
2k
views
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 ...