From da32b9c4f53514bb6d102b52c38ceed88fe5a304 Mon Sep 17 00:00:00 2001 From: Edex Date: Sun, 4 Feb 2024 16:21:51 +0200 Subject: [PATCH] Add searchable option to form builder select field --- src/Services/Forms/Fields/Select.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Services/Forms/Fields/Select.php b/src/Services/Forms/Fields/Select.php index 5eb9f3d13..a2163b26e 100644 --- a/src/Services/Forms/Fields/Select.php +++ b/src/Services/Forms/Fields/Select.php @@ -14,6 +14,8 @@ class Select extends BaseFormField use HasPlaceholder; use Unpackable; + protected bool $searchable = false; + public static function make(): static { return new self( @@ -21,4 +23,14 @@ public static function make(): static mandatoryProperties: ['name', 'label', 'options'] ); } + + /** + * If the options should be searchable. + */ + public function searchable(bool $searchable = true): static + { + $this->searchable = $searchable; + + return $this; + } }