Correctly validate the options in `Widget::isValidOption()` (see #5951)