Skip to content

Commit

Permalink
Merge pull request #129 from gpibarra/labels
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeWithDennis authored Nov 3, 2024
2 parents 3b1bef4 + 95aedb0 commit 21655e2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/SelectTree.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ class SelectTree extends Field implements HasAffixActions

protected bool $alwaysOpen = false;

protected string $emptyLabel = '';

protected bool $independent = true;

protected ?string $customKey = null;
Expand Down Expand Up @@ -138,6 +136,8 @@ protected function setUp(): void

$this->dehydrated(fn (SelectTree $component): bool => ! $component->getRelationship() instanceof BelongsToMany);

$this->placeholder(static fn (SelectTree $component): ?string => $component->isDisabled() ? null : __('filament-forms::components.select.placeholder'));

$this->suffixActions([
static fn (SelectTree $component): ?Action => $component->getCreateOptionAction(),
]);
Expand Down Expand Up @@ -338,7 +338,7 @@ public function expandSelected(bool $expandSelected = true): static

public function emptyLabel(string $emptyLabel): static
{
$this->emptyLabel = $emptyLabel;
$this->noSearchResultsMessage($emptyLabel);

return $this;
}
Expand Down Expand Up @@ -459,7 +459,7 @@ public function getDefaultOpenLevel(): int

public function getEmptyLabel(): string
{
return $this->emptyLabel ? $this->evaluate($this->emptyLabel) : __('No options match your search.');
return $this->getNoSearchResultsMessage();
}

public function getDirection(): string
Expand Down

0 comments on commit 21655e2

Please sign in to comment.