Skip to content

Commit

Permalink
Improve tags (using filament translations)
Browse files Browse the repository at this point in the history
  • Loading branch information
gpibarra committed Nov 2, 2024
1 parent 2e69bbc commit 0d1fdf5
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 @@ -136,6 +134,8 @@ protected function setUp(): void
return $component->getCustomKey($record);
});

$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 @@ -336,7 +336,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 @@ -457,7 +457,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 0d1fdf5

Please sign in to comment.