raimohanska / ourboard

An online whiteboard

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Text doesn't wrap in a sticky note when pasting

timojaask opened this issue · comments

Screen Shot 2021-10-15 at 8 50 44 AM

In the screenshot above, both sticky notes have exactly the same text. The first one was entered entirely by typing "OOOOO OOOOO". The second one was entered by typing the first word "OOOOO " and then pasting from clipboard the second word "OOOOO".

I'm guessing that the text measurement step is only done when you type, and omitted when pasting?

Interestingly in the latter case, the DOM element ends up having a non-breaking space between the OOOOOs.

image

Already when the space after the first OOOOO is input by pressing the spacebar, it's actually an   which is then converted to a normal space after typing more characters. In case of paste, it will remaing  . Oh the quirks.

To add more spin, this weirdness happens with Chrome and Safari but not Firefox. On Firefox the space is just an ordinary space.

Hopefully the fix is acceptable. Would appreciate some testing after the fix is in production. Should be in a few minutes.