Skip to content
This repository was archived by the owner on Jun 12, 2024. It is now read-only.

Commit 5790cfe

Browse files
committed
remove placeholder from inline multiselects as it gets in the list as a default empty option
1 parent 8f3e33a commit 5790cfe

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/DataForm/Field/Multiselect.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ public function getValue()
2222

2323
if (is_array($this->value)) {
2424
$this->values = $this->value;
25-
}
26-
else {
25+
} else {
2726
$this->values = explode($this->serialization_sep, $this->value);
2827
}
2928

@@ -62,6 +61,8 @@ public function build()
6261
case "create":
6362
case "modify":
6463
$this->attributes['multiple'] = 'multiple';
64+
$this->attributes['data-placeholder'] = $this->attributes['placeholder'];
65+
$this->attributes['placeholder'] = null;
6566
$output .= Form::select($this->name . '[]', $this->options, $this->values, $this->attributes);
6667
$output .= $this->extra_output;
6768
break;
@@ -72,6 +73,7 @@ public function build()
7273

7374
default:
7475
}
76+
7577
$this->output = $output;
7678
}
7779
}

0 commit comments

Comments
 (0)