From db9ac13860bce58235a5da275910bea605a00626 Mon Sep 17 00:00:00 2001 From: Yassine Doghri Date: Fri, 23 Sep 2022 11:59:47 +0000 Subject: [PATCH] fix(input-component): unset required attribute to prevent rendering it when false --- app/Views/Components/Forms/Input.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Views/Components/Forms/Input.php b/app/Views/Components/Forms/Input.php index fbb15ef3..4a705ed2 100644 --- a/app/Views/Components/Forms/Input.php +++ b/app/Views/Components/Forms/Input.php @@ -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'; }