Skip to content

Commit d7d388e

Browse files
committed
Set dynamic default for treeKey property
Updated the treeKey property to use a dynamic default value, ensuring more flexibility. Also adjusted the setUp method to initialize treeKey with a randomized suffix for uniqueness.
1 parent 8ccde12 commit d7d388e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/SelectTree.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class SelectTree extends Field implements HasAffixActions
8888

8989
protected Closure|array|null $prepend = null;
9090

91-
protected Closure|string|null $treeKey = 'defaultTreeKey';
91+
protected Closure|string|null $treeKey = 'treeKey';
9292

9393
protected function setUp(): void
9494
{
@@ -147,6 +147,8 @@ protected function setUp(): void
147147
$this->suffixActions([
148148
static fn (SelectTree $component): ?Action => $component->getCreateOptionAction(),
149149
]);
150+
151+
$this->treeKey('treeKey-'.rand());
150152
}
151153

152154
protected function buildTree(): Collection

0 commit comments

Comments
 (0)