utils/widgets: Update the value type when setting a new value