Xzensi / NipahTV

✨ NipahTV - A Better Kick and 7TV Emote Extension for Kick ✨
3 stars 2 forks source link

Ancient contenteditable browser bugs causing text to be pushed out of input field #59

Open Xzensi opened 3 months ago

Xzensi commented 3 months ago

Ancient 12 years old browser bug. To prevent empty contenteditable elements from collapsing to 0 height Firefox decided to automatically inject <br>. Chrome does not do this and solved it a different way.

To deal with this any <br> tags now always get removed automatically and CSS sets either height or min-height to deal with collapsing input. For Firefox this worked fine, however Chrome still has collapsing input issues where the text in input somehow gets shifted upwards visually and gets shifted back correctly when the cursor clicks on the input field.