We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e4a2035 commit 3b91620Copy full SHA for 3b91620
src/SimpleSelect.php
@@ -29,9 +29,9 @@ class SimpleSelect extends Component
29
* @return void
30
*/
31
public function __construct(
32
- array $options,
33
- string $id,
34
- string $name,
+ array $options = [],
+ string $id = null,
+ string $name = null,
35
$valueField = 'value',
36
$textField = 'text' ,
37
$value = null ,
@@ -57,6 +57,13 @@ public function __construct(
57
$this->maxSelection = $maxSelection;
58
$this->searchable = $searchable;
59
$this->clearable = $clearable;
60
+
61
+ if (!$this->id) {
62
+ $this->id = 'simple-select-' . uniqid();
63
+ }
64
+ if (!$this->name) {
65
+ $this->name = $this->id;
66
67
}
68
69
/**
0 commit comments