lovasoa / react-contenteditable

React component for a div with editable contents
http://npmjs.com/package/react-contenteditable
Apache License 2.0
1.64k stars 218 forks source link

How do i remove <div> tags from inside the text #206

Closed Ali-hd closed 4 years ago

Ali-hd commented 4 years ago

Hello I have been looking around for a solution to this but couldn't find anything clear.

I'm trying to save the text from the but the text has

tags inside it when i press enter. It gets saved to the database like that and when I use it the newl ines don't show up it only a single line with first line <div>second line </div><div>third lin</div>.

I want the user to be able to press enter and have new lines just like twitter input box

Ali-hd commented 4 years ago

github ignored the divs and showed it correctly.. this is what i mean first line <div>second line</div><div>third line</div>

lovasoa commented 4 years ago

Hello, this is more of a question than an issue with this repository, so I'll close this to help with project management. Feel free to keep commenting below, though.

lovasoa commented 4 years ago
Ali-hd commented 4 years ago

I added [contenteditable=true]{display: inline-block;} to my css and it solved it !