Questions tagged [draft-js-plugins]

123 questions
20
votes
2 answers

draft-js Cannot read property 'getIn' of undefined ( getUpdatedSelectionState )

I have this error with draft-js with draft-js-plugins-editor STRANGE BEHAVIOR: it only happens, when I refocus to first line of editor after writing, when trying to set for eg. the header of first line to H1 it changes previous focused line ERROR:…
Andrej Lacko
  • 319
  • 2
  • 9
8
votes
1 answer

Cursor inside Entity after selection in draft-js

I'm struggling making entities style work the way I would like to using draft-js. I'm adding styled entities to my input by selecting items in an autocomplete component. When I select one, it works, but the caret stays inside the entity until i add…
7
votes
3 answers

Render html saved from draft-js

I'm learning React: totally newbie. If I save in DB the HTML directly from draft.js (or it's variants always based on it) and then in a view page of my React SPA I retrieve HTML from DB through my API: QUESTIONS: how can I render that HTML?…
user4412054
6
votes
0 answers

How to create a table with DraftJS

Is there any way to create a table with DraftJS or any plugins? A plugin which allows the user to enter custom HTML (with table support) would be sufficient. As I understand it, a plugin can render as a table but I need to be able to edit the table,…
pythonjsgeo
  • 5,122
  • 2
  • 34
  • 47
5
votes
2 answers

react-draft-wysiwyg - Warning: Can't call setState

I did make a simple react app with react-draft-wysiwyg, but I get a warning. import React from "react"; import ReactDOM from "react-dom"; import { Editor } from "react-draft-wysiwyg"; import…
5
votes
1 answer

Custom Inline Toolbar in draft-js-plugins is not working

Custom Inline Toolbar, as prescribed in their documentation is not working as expected. It keeps showing the default Inline Toolbar, even though custom buttons are added. My code goes below. import Editor from "draft-js-plugins-editor"; import…
Balasubramani M
  • 7,742
  • 2
  • 45
  • 47
5
votes
2 answers

How to add custom dropdown menu in react-draft-wysiwyg?

I need to add custom dropdown menu in toolbar section. here attached image similar to want dropdown menu this is possible ? Dropdown menu editor find the detailed image below I used…
5
votes
3 answers

How to programatically add mentions using draft-js-mention-plugin?

The problem: I'm trying to create an edit interface for contents created with draft-js + draft-js-mention-plugin. However, editorState wasn't persisted, only plain text. Mentions were saved as an array of objects. Now I need to recreate the…
Diego Haz
  • 952
  • 1
  • 6
  • 24
5
votes
3 answers

How to stop DraftJS cursor jumping to beginning of text?

Code involved using DraftJS and Meteor Js application Task - Make a live preview where text from DraftJS will get saved to DB and from DB it get displayed on another component. But problem is once data comes from DB and I try to edit DraftJS cursor…
Sandeep Chikhale
  • 1,505
  • 2
  • 21
  • 36
5
votes
1 answer

Draftjs mention plugin with browserify

I tried to get the mention plugin in draft-js get working with Browserify. This is because of the fact that our application is build with Browserify. It's about this plugin: https://www.draft-js-plugins.com/plugin/mention In the examples they are…
sneeky
  • 1,458
  • 2
  • 13
  • 19
4
votes
3 answers

Using Draft js mention plugin with react hooks

I have been trying to get draft js mention plugin to work with react hooks but can't seem to figure what's wrong with the code. Appreciate any help on this. import React, { useRef, useState, useEffect } from "react"; import { EditorState } from…
Adrian
  • 105
  • 2
  • 6
4
votes
3 answers

React-Draft-Wysiwyg: Autoscroll on new line

How can I make editor's input to scroll down automatically on new line input? Like in example 6 at https://jpuri.github.io/react-draft-wysiwyg/#/demo. Now scroll stays on top and text cursor hides when goes below bottom border.
4
votes
1 answer

Highlight words in draft-js NPM

I have a draft-js rich editor. All I need is to highlight some words which I can supply to it in array. Just like I can supply some words in array to my editor and based on some class, it can highlight those. Any info about any external library…
Raghvender Kataria
  • 1,457
  • 7
  • 14
4
votes
1 answer

Mention list and emoji top position (Draft.js)

Will you please help me how I can change its position from bottom to top? I want to show mention list on top of the text instead of the bottom. The same question about emoji list. Example link.
Hasnain Shafqat
  • 118
  • 2
  • 9
4
votes
2 answers

How to extend theme of draft-js-emoji-plugin

I need to extend only several CSS rules in draft-js-emoji-plugin. Documented way is to pass theme object to configuration: const theme = { emojiSelectButton: 'someclassname' }; const emojiPlugin = createEmojiPlugin({theme}); Unfortunately, this…
Boris Zagoruiko
  • 12,705
  • 15
  • 47
  • 79
1
2 3
8 9