Skip to content

Commit

Permalink
Clear selection after tagging in bulk
Browse files Browse the repository at this point in the history
  • Loading branch information
GeniJaho committed Mar 12, 2024
1 parent be0acc8 commit d3a42f1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion resources/js/Components/TextInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ defineExpose({ focus: () => input.value.focus() });
<template>
<input
ref="input"
class="block w-full rounded-md border-0 py-1.5 text-gray-900 dark:text-gray-300 dark:bg-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 dark:ring-gray-700 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-500 dark:focus:ring-indigo-600 sm:text-sm sm:leading-6"
class="block rounded-md border-0 py-1.5 text-gray-900 dark:text-gray-300 dark:bg-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 dark:ring-gray-700 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-500 dark:focus:ring-indigo-600 sm:text-sm sm:leading-6"
:value="modelValue"
@input="$emit('update:modelValue', $event.target.value)"
>
Expand Down
1 change: 1 addition & 0 deletions resources/js/Pages/Photos/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ const filter = (filters) => {
:photoIds="selectedPhotos"
:tags="tags"
:items="items"
@closeModalWithSuccess="clearSelection"
></BulkTag>
</div>

Expand Down
8 changes: 7 additions & 1 deletion resources/js/Pages/Photos/Partials/BulkTag.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ const props = defineProps({
tags: Object,
});
const emit = defineEmits(['closeModalWithSuccess'])
const page = usePage();
const selectedItem = ref(null);
const showModal = ref(false);
Expand Down Expand Up @@ -69,7 +71,11 @@ const closeModalWithSuccess = () => {
form.reset();
message.value = 'Tagged successfully!';
setTimeout(() => showModal.value = false, 3000);
setTimeout(() => {
showModal.value = false;
emit('closeModalWithSuccess');
}, 3000);
};
const closeModal = () => {
Expand Down

0 comments on commit d3a42f1

Please sign in to comment.