Skip to content

Commit 051b550

Browse files
Merge pull request #191 from nathanheffley/add-static-list-option
Add staticList option
2 parents 6e9db02 + 83a82ba commit 051b550

File tree

5 files changed

+24
-1
lines changed

5 files changed

+24
-1
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ Keep the dropdown open at all times
9595
->alwaysOpen()
9696
```
9797

98+
Add the list as a static DOM element so that it doesn't overlap content
99+
100+
```php
101+
->staticList()
102+
```
103+
98104
Set nodes as dependent
99105

100106
```php

resources/dist/filament-select-tree.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/js/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export default function selectTree({
1515
clearable = true,
1616
isIndependentNodes = true,
1717
alwaysOpen = false,
18+
staticList = false,
1819
emptyText,
1920
expandSelected = true,
2021
grouped = true,
@@ -59,6 +60,7 @@ export default function selectTree({
5960
clearable,
6061
isIndependentNodes,
6162
alwaysOpen,
63+
staticList,
6264
emptyText,
6365
expandSelected,
6466
grouped,

resources/views/select-tree.blade.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
isIndependentNodes: @js($getIndependent()),
3535
showTags: @js($getMultiple()),
3636
alwaysOpen: @js($getAlwaysOpen()),
37+
staticList: @js($getStaticList()),
3738
clearable: @js($getClearable()),
3839
emptyText: @js($getEmptyLabel()),
3940
expandSelected: @js($getExpandSelected()),

src/SelectTree.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ class SelectTree extends Field implements HasAffixActions
3838

3939
protected bool $alwaysOpen = false;
4040

41+
protected bool $staticList = false;
42+
4143
protected bool $independent = true;
4244

4345
protected ?string $customKey = null;
@@ -492,6 +494,13 @@ public function alwaysOpen(bool $alwaysOpen = true): static
492494
return $this;
493495
}
494496

497+
public function staticList(bool $staticList = true): static
498+
{
499+
$this->staticList = $staticList;
500+
501+
return $this;
502+
}
503+
495504
public function enableBranchNode(Closure|bool $enableBranchNode = true): static
496505
{
497506
$this->enableBranchNode = $enableBranchNode;
@@ -568,6 +577,11 @@ public function getAlwaysOpen(): bool
568577
return $this->evaluate($this->alwaysOpen);
569578
}
570579

580+
public function getStaticList(): bool
581+
{
582+
return $this->evaluate($this->staticList);
583+
}
584+
571585
public function getEnableBranchNode(): bool
572586
{
573587
return $this->evaluate($this->enableBranchNode);

0 commit comments

Comments
 (0)