D
D
Dmitry Arushanov2018-11-02 15:46:58
JavaScript
Dmitry Arushanov, 2018-11-02 15:46:58

How to fix contenteditable in Mozilla FireFox?

Good day to all!
There is a div with `contenteditable=true` attribute.
In chrome, when you type text and put a space at the end of the line, it converts it to 

`Hello ` -> `Hello `
`Hello World ` -> `Hello World `
`Hello World` -> `Hello World`

In the mozilla she puts `<br>`instead. &nbsp;
Is there any way to tell Mozilla that she didn't do that?
I thought at first to use defaultParagraphSeparator + document.execCommand. But I don't have a transfer.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question