Skip to content

Commit

Permalink
Add searchable option to form builder select field
Browse files Browse the repository at this point in the history
  • Loading branch information
iedex authored Feb 4, 2024
1 parent 1f443d8 commit da32b9c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Services/Forms/Fields/Select.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,23 @@ class Select extends BaseFormField
use HasPlaceholder;
use Unpackable;

protected bool $searchable = false;

public static function make(): static
{
return new self(
component: \A17\Twill\View\Components\Fields\Select::class,
mandatoryProperties: ['name', 'label', 'options']
);
}

/**
* If the options should be searchable.
*/
public function searchable(bool $searchable = true): static
{
$this->searchable = $searchable;

return $this;
}
}

0 comments on commit da32b9c

Please sign in to comment.