Add undo handling to TextInput