refactoring: simplify maxlength warning class
make sure that if there is a  maxlength then show it by default