I have a contenteditable div element with the class ".textarea_mask."
<div class=".textarea_mask" contenteditable ></div>
My goal is to make this div act like a text area. It functions correctly in modern browsers, but I am having issues with Internet Explorer 8. When entering a long phrase like
abcdefghijklmnopqrstuvqxyzabcdefghijklmnopqrstuvqxyzabcdefghijklmnopqrstuvqxyz
, the text breaches the boundaries of the div and causes it to expand or hide when applying overflow-x: none.
Is there a way using jQuery to detect overflow and truncate the long phrase so it fits within the div's width?
Note: Typing standard text like "A cat and a dog" will automatically move to the next line.
Thank you for any assistance.