Questions tagged [draft-js-plugins]
123 questions
1
vote
1 answer
How to use draft-js-plugins in react-hook-form
I am using react-hook-form and draft.js as wysiwiyg.
My code where I am using draft-js-plugins:
import React, {useRef} from "react";
import { Controller } from "./src";
import Editor from "@draft-js-plugins/editor";
import createToolbarPlugin from…

user2772197
- 205
- 2
- 11
1
vote
4 answers
How to add a tooltip to a selection?
When the users selects some text, I want to be able to show a tooltip, right below the selected text?
Any ideas how can I do that?

glafche
- 101
- 6
1
vote
1 answer
Draft JS: hide the cursor
I'm trying to hide the cursor in draft-js. I want it to function as normal but the user not to be able to see the blinking cursor, is there any way of doing this in draft JS?

user3472360
- 1,337
- 1
- 16
- 29
1
vote
0 answers
How to stop caret blinking in Draft.js?
I wanted to stop the caret from blinking in case of readonly mode. Is there a way to achieve it?
I tried setting animation property in .public-DraftEditor-content but doesn't seem to work.
I don't want to hide the cursor hence making it transparent…

Prashant Shubham
- 456
- 8
- 20
1
vote
1 answer
DraftJS. Wrap up custom HTML tag with a custom Component
Trying to implement smth similar with pure Draft.js:
To be more precise, i want to have these hidden blocks of original message(s) that are editable and expandable by clicking three-dots icon
So, after some research i found out there are Custom…

Ivan L
- 181
- 1
- 10
1
vote
0 answers
Draft.JS How to create custom link or span based on custom entity
Using draft.js how you go about adding a custom link entity with meta data?
Example of what I did:
For one of my editor menu buttons I have added a click handler that creates an entity called 'META_WRAPPER':
const handleMetaWrapperBtnClick = ()…

Kamran
- 819
- 3
- 14
- 22
1
vote
1 answer
Draftjs replaceText conserving style
I'm using Draftjs with draft-js-plugins-editor, I'm using two plugins : draft-js-mathjax-plugin and draft-js-mention-plugin
When the user is mentioning element(s) using '@' I want later to replace all the mentions by values. For example "You have…

axel7083
- 571
- 3
- 16
1
vote
1 answer
Draft.js - convert current block to Atomic Block
I'm working on a custom draft.js plugin that inserts an Atomic Block with a GIF in it. I started by copying the Draft.js Image Plugin as it's almost identical. I've got my plugin working but there's one issue I'm not sure best how to solve.
To…

Merlin Mason
- 1,607
- 2
- 12
- 14
1
vote
0 answers
"n.createFromText not a function" error when trying to initialize editor with text
Trying to truncate text inside the editor before I display it to the user but I am getting the following error,
please take a small look you might catch some thing I am missing
main.js:46 TypeError: n.createFromText is not a function
My code
…

bihire boris
- 1,530
- 3
- 19
- 44
1
vote
1 answer
DraftJs trim content with all styling and other properties, not just text
I have a react application and using DraftJs.
On listing pages my ContentCard component renders DraftJs content as read-only using Editor from draft-js.
I want to show short version of…

Erdal SATIK
- 652
- 2
- 9
- 32
1
vote
0 answers
Uploaded image not added as inline in text editor when custom block rendering is also added in React-draft-wyswyg
I have a text editor created using react-draft-wysiwyg. I have created a custom blockrendering function which enables in adding a custom block.
Editor code :

aham
- 137
- 11
1
vote
1 answer
How to pass props to strategy function for decorator in draft.js
I have a strategy function for a decorator and I would like to pass props to the strategy function
I have tried the code below but It gives me cannot read property props of undefine
const highlightWorngWords = (contentBlock, callback , props …

Rami Salim
- 182
- 2
- 11
1
vote
1 answer
How to Decorate a text with Modifier in Draft.js
I'm trying to decorate some text, but instead of making the process managed by a regex strategy, it should be the results of an ajax call to specify which peace of text to decorate. Is it possible to use any method from Modifier library? My idea is…

Word matching
- 11
- 3
1
vote
3 answers
How to update Editor state from given JSON data of ContentState in react-draft-wysiwyg?
This is my editor.js
I have sample JSON data in const content.
What I want to do is that , initially when I open my editor , it should render the initial content in the variable content.
But I have no idea how to update the editorState as it is…

quepayal
- 57
- 2
- 12
1
vote
1 answer
Using a higher order component with multiple Draft.js editors in single page
I am working on a homepage that consists of eight different components representing various aspects of the page content. I want to have three of them be editable using a custom built InlineEditor component that uses Draft.js. When I tried to do this…

wildlifehexagon
- 523
- 6
- 26