Correctly validate the unit selection in the relevant widgets (see #7246)