Use local state text when editing, fix cursor and deletion handling