Limit div contents within div even if user tries to tab or indent

Indrani Source

I have wysiwyg editor based on draft.js and the editor is actually a div. If I write some content within the div or paste some image and try to tab again and again, the contents gets indented outside the visible portion of the div. I want that if the contents reach the end of the div and then user presses tab, the content should move to the next line or better stay where it is. It should not move outside the visible range of the div. I don't want to introduce a horizontal scroll.

original

after tabbing past div boundary

javascripthtmlcsswysiwygdraftjs

Answers

comments powered by Disqus