Correctly add the CSS classes in the  widget (see #7037)