[BUGFIX] Respect argument 'required' for input and text fields

Fixes #284.