Questions tagged [draft-js-plugins]

123 questions
2
votes
1 answer

Make DraftJS editor controlled by Formik: string value doesn't convert well to EditorState

I use react-draft-wysiwyg editor which's state should be controlled by Formik. The idea is the Formik value being a string, so Editor state is converted to HTML with stateToHTML and set as value, and when received from Formik, it is converted form…
Dune
  • 674
  • 1
  • 9
  • 19
2
votes
1 answer

How to include Attach File option in react-draft-wysiwyg?

I am trying to create a text editor using react-draft-wysiwyg. Editor code
aham
  • 137
  • 11
2
votes
0 answers

draft-js Editor only display native emojis

after getting the contentState from server and "converting From Raw" Im displaying it inside an Editor and it shows only the native emojis. event though that before sending it to the server, the chat editor displayed the emojis right this is the…
elad BA
  • 1,760
  • 11
  • 17
2
votes
2 answers

React Draft.js toolbar plugin not showing

I've followed the docs on installing the inline and static toolbar plugins, but they seems to be nonexistent. I'm using the Create React App CLI. The component: import React from 'react'; import {EditorState} from 'draft-js'; import Editor from…
Draxy
  • 565
  • 3
  • 6
  • 20
2
votes
1 answer

Draft.js. How can I update block atomic:image src later on for example article save?

I am having trouble updating my image blocks in editorState in draft.js. I want to change atomic:image src on button save. So the src is for example now blob:http://localhost:3000/7661d307-871b-4039-b7dd-6efc2701b623 but I would like to update to…
jonjonson
  • 263
  • 2
  • 5
  • 16
2
votes
0 answers

DraftJS - creating a mention entity

Using DraftJS (and DraftJS Mention Plugin), in my Editor component, I am trying to create a mention entity when I receive data from my backend such as: "Hey there, @john12345!" I need to change the slug into a mention entity. What is the best way to…
ces_520
  • 71
  • 1
  • 5
2
votes
2 answers

Draft.js and stateToHTML, how to render output html in react component?

I've got my Draft js editor working fine, it saves to my database, using convertToRaw(editorState1.getCurrentContent()), and I am getting it back and converting it to HTML using draft-js-export-html and…
Winter
  • 2,407
  • 1
  • 19
  • 28
2
votes
2 answers

Draft-js get mention position in editorState currentContent

I'm using draft-js-mention-plugin and I'm looking for a method that returns the mention position in the whole text (without using indexOf()). For exemple, I want to get the beginning and the ending positions of piRstone in this sentence : Welcome to…
piRstone
  • 336
  • 3
  • 16
1
vote
0 answers

how to convert draft js block response to html string with text alignment?

In my React project, I'm using the Draft.js editor with alignment plugins to allow users to align text. Now, I want to export the content from the editor to a PDF file. To do that, I need to convert the Draft.js content (in JSON format) to an HTML…
1
vote
0 answers

Problem rendering inline tex with draftjs-latex-plugin

I am using draft-js-latex-plugin package to implement Tex in my Draft-JS editor. The documentation of the package says the following: Press $ for starting Inline TeX Press CMD + M for starting Tex Block To write the $ character, type $ Now when I…
1
vote
1 answer

How to convert draft-js mentions into html?

I am using "@draft-js-plugins/mention" plugin together with rich text functionality provided by draft-js. Also, I'm using "draft-js-export-html" library to convert the editor state into html. However, this library converts only rich text styling to…
K M
  • 31
  • 1
  • 4
1
vote
0 answers

Draft js - Add entity on editorState change

I am using Draft JS for its Mentions plugin. What I would like to do is to give the user the possibility to insert mentions programmatically so that when he types (for example) "@*", the following word will be managed as an entity. I've written this…
1
vote
1 answer

How to delete the image (from database) after using backspace in editor ? (draftjs)

If suppose the user uploaded the image but later he decided to remove the image using backspace or delete then how it will delete from the database. Currently, it's not deleting from the database and creating the junks. Please advise
1
vote
1 answer

How to change the font size of the bullets of an unordered list item in draftjs?

I have a rich text editor built using draftjs. I implemented the functions for changing the font size, font family, and color of the text in the editor. I also implemented the functionality of adding unordered and ordered list items. The issue is…
1
vote
0 answers

Draft.js comes with error: stack frames were collapsed

This is a question on how to deal with pasted image using draftjs in the case of Japanese input mode. Recently I am using Draft.js as text editor. Sometimes we need to insert image into the editor like copy image and paste the image into the editor…
Zhongwei Xu
  • 147
  • 9
1 2
3
8 9