Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix searchable option for formbuilder select field #2415

Merged
merged 1 commit into from
Feb 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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

Check warning on line 30 in src/Services/Forms/Fields/Select.php

View check run for this annotation

Codecov / codecov/patch

src/Services/Forms/Fields/Select.php#L30

Added line #L30 was not covered by tests
{
$this->searchable = $searchable;

Check warning on line 32 in src/Services/Forms/Fields/Select.php

View check run for this annotation

Codecov / codecov/patch

src/Services/Forms/Fields/Select.php#L32

Added line #L32 was not covered by tests

return $this;

Check warning on line 34 in src/Services/Forms/Fields/Select.php

View check run for this annotation

Codecov / codecov/patch

src/Services/Forms/Fields/Select.php#L34

Added line #L34 was not covered by tests
}
}
Loading