Using "Enter" to add a new line does not work as expected
See original GitHub issueI tried the library using this codesandbox: https://codesandbox.io/s/l91xvkox9l
If I use Shift + Enter
to add a new line it works.
If I use Enter
to add a new line, then click away to on blur it, it removes lines that were created.
Basically:
“AAAAA
aa
AA”
becomes “AAAAAaaAA”
browser: Chrome - version 78.0.3904.97
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Enter Key Not Skipping Line--HELP!! - Microsoft Community
Hi, The Enter key is not to move down the page or start a new line. In Word, it is to end a...
Read more >New Line '\n' is not working in Typescript - Stack Overflow
I am creating a list item in typescript component ...
Read more >Enter key does not work as expected in RDp and RDi LPEX ...
When the Enter key is used in the LPEX editor for COBOL it does not do the split as expected. Instead it moves...
Read more >Pressing Enter Key gives space instead of newline - Super User
To fix this, I had to open a new document, then copy and paste the text. Make sure not to copy and paste...
Read more >Adding a Newline Character to a String in Java - Baeldung
We can also use Unicode characters “& #13;” (Carriage Return) and “& #10;” (Line Feed). Although these characters work, they don't work exactly ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
My solution involves using
white-space: pre-wrap;
and then controlling the enter key in order to prevent the insertion of div/p:Bon, essayons en français 😛
Quel navigateur utilisez-vous ? Firefox, chrome, safari… ? Et quelle version ?
Pouvez-vous créer un élément avec la propriété contenteditable en dehors de react-contenteditable, et indiquer si vous constatez le même problème ?