Skip to content

Commit 21655e2

Browse files
Merge pull request #129 from gpibarra/labels
2 parents 3b1bef4 + 95aedb0 commit 21655e2

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;
@@ -138,6 +136,8 @@ protected function setUp(): void
138136

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

139+
$this->placeholder(static fn (SelectTree $component): ?string => $component->isDisabled() ? null : __('filament-forms::components.select.placeholder'));
140+
141141
$this->suffixActions([
142142
static fn (SelectTree $component): ?Action => $component->getCreateOptionAction(),
143143
]);
@@ -338,7 +338,7 @@ public function expandSelected(bool $expandSelected = true): static
338338

339339
public function emptyLabel(string $emptyLabel): static
340340
{
341-
$this->emptyLabel = $emptyLabel;
341+
$this->noSearchResultsMessage($emptyLabel);
342342

343343
return $this;
344344
}
@@ -459,7 +459,7 @@ public function getDefaultOpenLevel(): int
459459

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

465465
public function getDirection(): string

0 commit comments

Comments
 (0)