Skip to content
This repository was archived by the owner on Mar 18, 2025. It is now read-only.

Commit 25e19e0

Browse files
committed
Add a required flag to the tree-select component
1 parent defa940 commit 25e19e0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Components/Livewire/TreeSelect.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ abstract class TreeSelect extends Component
2323
public bool $multiple = false;
2424
public bool $disabled = false;
2525
public bool $optional = false;
26+
public bool $required = false;
2627
public bool $searchable = true;
2728
public bool $closeOnSelect = false;
2829
public bool $autofocus = false;
@@ -169,7 +170,7 @@ public function mount(): void
169170
$this->showCheckbox = $this->multiple;
170171
}
171172

172-
if ($this->minSelected > 1) {
173+
if ($this->minSelected > 1 || $this->required) {
173174
$this->optional = false;
174175
}
175176

0 commit comments

Comments
 (0)