fix(input-component): unset required attribute to prevent rendering it when false

This commit is contained in:
Yassine Doghri 2022-09-23 11:59:47 +00:00
parent f74403bd7a
commit db9ac13860
1 changed files with 2 additions and 0 deletions

View File

@ -20,6 +20,8 @@ class Input extends FormComponent
$this->attributes['class'] .= ' px-3 py-2';
}
unset($this->attributes['required']);
if ($this->required) {
$this->attributes['required'] = 'required';
}