Skip to content

Commit 76a417e

Browse files
committed
Update custom file input.
1 parent 954fc0a commit 76a417e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/View/Helper/BootstrapFormHelper.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,9 @@ public function file($fieldName, array $options = []) {
399399
];
400400

401401
$fakeInputCustomOptions = $options['_input'];
402+
$fakeInputCustomOptions += [
403+
'value' => ''
404+
];
402405
$fakeButtonCustomOptions = $options['_button'];
403406
unset($options['_input'], $options['_button']);
404407

@@ -412,7 +415,7 @@ public function file($fieldName, array $options = []) {
412415
'onchange' => "document.getElementById('".$options['id']."-input').value = (this.files.length <= 1) ? this.files[0].name : this.files.length + ' ' + '" . $countLabel . "';"
413416
]));
414417

415-
$fakeInput = $this->text($fieldName, array_merge($options, $fakeInputCustomOptions, [
418+
$fakeInput = $this->text($fieldName, array_merge($fakeInputCustomOptions, [
416419
'name' => $fieldName.'-text',
417420
'readonly' => 'readonly',
418421
'id' => $options['id'].'-input',

0 commit comments

Comments
 (0)