Issue with contenteditable Element

Im trying to get rid of the <div><br></div> thats added to a contenteditable element after ‘enter’ is pressed on android.

I learned that if i added css white-space: pre or display: inline-block or white-space: pre-wrap to the element it would get rid of it, which it did, but not on android. Everything works just as expected on chrome windows, but on chrome android it doesn’t work at all. The <div><br></div> is still added, and what’s even weirder is that it adds two of them.

Because its on android, i have to use input events and not key events so when i tried simply replacing the added elements with n it would do even stranger things.

Does anyone have a solution to this? Ive been trying to find to a solution for literally days, and have tried what feels like everything.