don't reset cursor on state change
remove empty function
send updated text direclty whenever the text editor was left (e.g. when the submit button was clicked)