Handle onclick better for changing tree focus