update selection details on change
This commit is contained in:
@@ -769,6 +769,7 @@ const handleFilesUpload = (files: FileList) => {
|
|||||||
status: "",
|
status: "",
|
||||||
storage: "",
|
storage: "",
|
||||||
url: "",
|
url: "",
|
||||||
|
thumbnail: "",
|
||||||
description: "",
|
description: "",
|
||||||
dimensions: "",
|
dimensions: "",
|
||||||
variants: {},
|
variants: {},
|
||||||
@@ -987,6 +988,22 @@ watch(page, () => {
|
|||||||
handleLoad();
|
handleLoad();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
watch(mediaItems, () => {
|
||||||
|
selected.value = selected.value.map((selectedItem) => {
|
||||||
|
const matchingMediaItem = mediaItems.value.find(
|
||||||
|
(mediaItem) => mediaItem.id === selectedItem.id,
|
||||||
|
);
|
||||||
|
return matchingMediaItem || selectedItem;
|
||||||
|
});
|
||||||
|
|
||||||
|
if (lastSelected.value) {
|
||||||
|
lastSelected.value =
|
||||||
|
mediaItems.value.find(
|
||||||
|
(mediaItem) => mediaItem.id === lastSelected.value.id,
|
||||||
|
) || lastSelected.value;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine if the Select button should be disabled
|
* Determine if the Select button should be disabled
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user