Skip to content

Commit 08902e9

Browse files
Use label when saving multiple
1 parent 810dd1c commit 08902e9

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

resources/dist/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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default function tree({
2121
init() {
2222
const values = this.isSingleSelect
2323
? (this.state !== null ? this.state : '')
24-
: (this.state !== null ? this.state.split(',').map(Number) : '');
24+
: (this.state !== null ? this.state.split(',') : '');
2525

2626
this.tree = new Treeselect({
2727
id: `tree-${name}-id`,

src/SelectTree.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ private function buildTree(int $parent = null): Collection
147147
// Create an array representation of the current result with children.
148148
return [
149149
'name' => $result->{$this->titleAttribute},
150-
'value' => $result->id,
150+
'value' => $this->getMultiple() ? $result->{$this->titleAttribute} : $result->id,
151151
'children' => $children->isEmpty() ? null : $children->toArray(),
152152
];
153153
});

0 commit comments

Comments
 (0)