Questions tagged [draft-js-plugins]

123 questions
0
votes
1 answer

Draft JS linkify/mentions plugin on convertToRaw removes anchor tag

I am using the draft js editor and its linkify and mentions plugin. Adding link and mentions with link work fine on editor but when I try to get the html, anchor tags are removed from the content. My editor rendor return (
Saket
  • 69
  • 7
0
votes
1 answer

Draft-js-plugins emoji select component - close popover after select emoji

I'm using Draft-js-plugins emoji select component with react and I'm trying to close the popover upon selection of an emoji, I have read the documentation but didn't find a way to achieve that. Here is the documentation and Live Examples. You can…
Eyal Ovadya
  • 73
  • 1
  • 5
0
votes
2 answers

Draft-JS - Translating into an atomic block with convertFromHTML gets rid of Entity

So I have been trying to get the method convertFromHTML to translate Images into an atomic block so that it may be compatible with the draft-js-image-plugin since it expects blocks of the type atomic Given a simple HTML structure with some text and…
Tekill
  • 1,171
  • 1
  • 14
  • 30
0
votes
2 answers

Draft.js adding hyperlink using applyEntity doesn't seem to work

I've been working on this problem for a while, and I hope it's not a bug. I'm testing a text editor using Draft.js, and I'd simply like my users to add a hyperlink to their articles, so I create a function for that to happen by modifying the editor…
0
votes
1 answer

Draft JS, mention plugin renders as plain text

I am implementing React's "draft js" with mention plugin. https://www.draft-js-plugins.com/ So far i am able to create the editor and creating the mention tags. I can save the mentions in my database using rest API. Here is what i do on saving…
0
votes
2 answers

Adding image draft-js-image-plugin

I've tried multiple different ways to try to attach an image in draft-js. My attempts followed the example in the tutorial https://www.draft-js-plugins.com/plugin/image. For the "Add Image Button Example", the full source of which can be found here…
Alex Donley
  • 145
  • 3
  • 16
0
votes
1 answer

Cursor jumps to left when typing until after 2 characters

I am using draft-js-plugin-editor in TextArea. When I start typing, cursor jumps to the left until after 2 characters. For example, when typing "Information", this will type as "formationnI." It types as I, then n (from Right to Left), then…
bdfios
  • 657
  • 6
  • 17
  • 29
0
votes
1 answer

ReactJS DraftJS Initialize from Serialized Data

So I am using the DraftJS package with React along with the mentions plugin. When a post is created, I store the raw JS in my PostreSQL JSONField: convertToRaw(postEditorState.getCurrentContent()) When I edit the post, I set the editor state as…
0
votes
1 answer

Draftjs mentions plugin with scroll

The issue is keydown/keyup aren't working when mention list popup has scroll , i can scroll using mouse but keyup/keydown aren't making the scroll move to the right position
0
votes
1 answer

Vertical aligning of text within Draft JS editor

How can we vertically align text within a draftjs text editor? It should support top, center and bottom alignments.
Stanly
  • 663
  • 1
  • 9
  • 26
0
votes
2 answers

Draft-JS - Entity component doesn't re-render when data changes

I would like to have my text editor display how many times a content block has been selected and executed though a key command. I'm doing this by applying an entity to the selected block with a evaluatedTimes property. The data is changed correctly…
0
votes
1 answer

In draft-js using the staticToolBarPlugin, why does changing styles for selected text move text to new line?

So I will start out with this: Solar Power And then I bold, say, Solar, and I get this: Solar Power Why does it go into a new line?
faceyspacey.com
  • 2,510
  • 2
  • 20
  • 29
0
votes
1 answer

Draft.js insert image at dropped position

I'm trying to drop image from outside of draft-js editor but it's always inserted at last position of the cursor/selection in editor (or at end if cursor/selection not set). This is my wrap around draft-js-drag-n-drop-plugin const…
zhuber
  • 5,364
  • 3
  • 30
  • 63
0
votes
1 answer

Draft.js how to represent list of items?

In order to create image carousel, I thought creating nested blocks as following image_carousels image image image Then I found draft.js doesn't support nested blocks. (https://github.com/facebook/draft-js/issues/143 they say draft.js is flat)…
eugene
  • 39,839
  • 68
  • 255
  • 489
0
votes
2 answers

Draft.js insert one contentState into another

I have a Draft.js editor with some HTML in it. How can I insert a new piece of HTML at a current selection position, preserving both stylings and entity/block mappings? I know how to insert raw text via Modifier.insertText: const contentState =…
1 2 3
8 9