Skip to content

Commit 346ce36

Browse files
committed
fix common params overrides
1 parent 9b902a3 commit 346ce36

File tree

5 files changed

+17
-6
lines changed

5 files changed

+17
-6
lines changed

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
Changelog
22
=========
33

4-
1.1.0 (UNRELEASED)
4+
1.1.1 (2025-12-11)
5+
------------------
6+
7+
**Need to republish view `group.blade.php` if you publish it**
8+
9+
- Fix common params overrides
10+
11+
12+
1.1.0 (2025-12-11)
513
------------------
614

715
**Possible breaking changes if you extend components**

resources/views/group.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class="luh-group-item luh__sort-draggable"
1919

2020
@livewire(
2121
$this->itemComponentClassName(),
22-
$this->itemComponentParams($itemId),
22+
$this->itemsParams[$itemId] ?? [],
2323
key($itemId)
2424
)
2525
</div>

resources/views/item.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class="luh-dropzone"
99
<div x-show="! uploading">
1010
@if ($this->hasFile())
1111
<div class="luh-item-content" wire:key="content">
12-
@if ($showImagePreview && $this->fileType()?->isImage())
12+
@if ($showImagePreview && $this->fileExists() && $this->fileType()->isImage())
1313
<div class="luh-item-preview" x-bind:class="{'luh-item-deleted': deleted}">
1414
<img src="{{ $this->glideUrl(['w' => 70, 'h' => 70, 'fit' => 'crop']) }}">
1515
</div>

src/Livewire/Concerns/MediaCommon.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ protected function initialItemData(array $old = [], ?Media $media = null): array
4343
protected function initialItemParams(?Media $media = null): array
4444
{
4545
return [
46-
'savedFileDisk' => $media?->disk,
46+
'savedFileDisk' => $media->disk ?? $this->savedFileDisk,
4747
'savedFilePath' => $media?->getPathRelativeToRoot(),
4848
];
4949
}

src/Livewire/Group.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,11 @@ protected function addItem(?string $itemId = null, array $data = [], array $para
100100
$data['deleted'] ??= false;
101101

102102
$this->items[$itemId] = $data;
103-
$this->itemsParams[$itemId] = $params;
103+
104+
$this->itemsParams[$itemId] = [
105+
...$this->itemComponentParams($itemId),
106+
...$params,
107+
];
104108

105109
return $itemId;
106110
}
@@ -164,7 +168,6 @@ protected function itemComponentParams(string $itemId): array
164168
'wire:model' => 'items.'.$itemId,
165169
'inputBaseName' => $this->inputBaseName.'['.$itemId.']',
166170
'attachedToGroup' => true,
167-
...$this->itemsParams[$itemId] ?? [],
168171
...$this->publicPropsFrom(Common::class),
169172
];
170173
}

0 commit comments

Comments
 (0)