Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion resources/js/components/actions/BulkActions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const emit = defineEmits(['started', 'completed']);
const { prepareActions, runServerAction } = useActions();

let actions = ref([]);
let actionsReady = ref(false);

const confirmableActions = useTemplateRef('confirmableActions');

Expand Down Expand Up @@ -46,9 +47,12 @@ watch(props.selections, getActions, { deep: true });
function getActions() {
if (!hasSelections.value) {
actions.value = [];
actionsReady.value = false;
return;
}

actionsReady.value = false;

let params = {
selections: toRaw(props.selections),
};
Expand All @@ -59,7 +63,10 @@ function getActions() {

axios
.post(props.url + '/list', params)
.then(response => actions.value = response.data);
.then(response => {
actions.value = response.data;
actionsReady.value = true;
});
}

let errors = ref({});
Expand Down Expand Up @@ -91,5 +98,6 @@ function runAction(action, values, onSuccess, onError) {
<slot
v-if="showAlways || hasSelections"
:actions="preparedActions"
:actionsReady="actionsReady"
/>
</template>
4 changes: 2 additions & 2 deletions resources/js/components/ui/Listing/BulkActions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ function actionFailed(response) {
:context="actionContext"
@started="actionStarted"
@completed="actionCompleted"
v-slot="{ actions }"
v-slot="{ actions, actionsReady }"
>
<Motion
v-if="hasSelections"
v-if="hasSelections && actionsReady"
layout
data-floating-toolbar
class="fixed inset-x-0 bottom-1 sm:bottom-6 z-100 flex w-full max-w-[95vw] mx-auto justify-center "
Expand Down