Skip to content

Commit 0d1fdf5

Browse files
committed
Improve tags (using filament translations)
1 parent 2e69bbc commit 0d1fdf5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/SelectTree.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ class SelectTree extends Field implements HasAffixActions
3636

3737
protected bool $alwaysOpen = false;
3838

39-
protected string $emptyLabel = '';
40-
4139
protected bool $independent = true;
4240

4341
protected ?string $customKey = null;
@@ -136,6 +134,8 @@ protected function setUp(): void
136134
return $component->getCustomKey($record);
137135
});
138136

137+
$this->placeholder(static fn (SelectTree $component): ?string => $component->isDisabled() ? null : __('filament-forms::components.select.placeholder'));
138+
139139
$this->suffixActions([
140140
static fn (SelectTree $component): ?Action => $component->getCreateOptionAction(),
141141
]);
@@ -336,7 +336,7 @@ public function expandSelected(bool $expandSelected = true): static
336336

337337
public function emptyLabel(string $emptyLabel): static
338338
{
339-
$this->emptyLabel = $emptyLabel;
339+
$this->noSearchResultsMessage($emptyLabel);
340340

341341
return $this;
342342
}
@@ -457,7 +457,7 @@ public function getDefaultOpenLevel(): int
457457

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

463463
public function getDirection(): string

0 commit comments

Comments
 (0)