Avoid TypeError on tapping range elements