Don't generate type if control might be hidden, for #1863