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

Commit ab88d39

Browse files
committed
Fix always false issue with checked
1 parent b5f7873 commit ab88d39

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Components/Choice/Checkbox.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ public function __construct(
2020
public bool $checked = false,
2121
) {
2222
$this->id = $this->id ?? $this->name;
23-
$this->checked = (bool) old($this->name, $this->checked);
23+
24+
if ($this->name) {
25+
$this->checked = (bool) old($this->name, $this->checked);
26+
}
2427
}
2528
}

0 commit comments

Comments
 (0)