Skip to content
Open
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
4 changes: 2 additions & 2 deletions src/SelectTree.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ protected function setUp(): void
static fn (SelectTree $component): ?Action => $component->getCreateOptionAction(),
]);

$this->treeKey('treeKey-'.rand());
$this->treeKey(fn (SelectTree $component): string => 'treeKey-'.$component->getStatePath());
}

protected function buildTree(): Collection
Expand Down Expand Up @@ -810,7 +810,7 @@ public function createOptionModalHeading(string|Closure|null $heading): static
return $this;
}

public function treeKey(string $treeKey): static
public function treeKey(Closure|string $treeKey): static
{
$this->treeKey = $treeKey;

Expand Down