JSFiddle - React, Tailwind, and code Playground

by Deepak Kumar

HTML

<div id="editor" contenteditable='true'>
    If user types in this area it should fire an event if the end of line reached while typing i.e. when cursor switches the line.
    
    <br/><br/>
    
    Also an event should fire when cursor has reached end of the div. i.e. when content overflows the div.
</div>

CSS

#editor {
    border: 1px solid green;
    background-color: #F6F6F6;
    padding: 10px;
    width: 50%;
    height: 150px;
    font-size: 17px;
}