Unverified Commit f2de606c authored by Björn Grüning's avatar Björn Grüning Committed by GitHub
Browse files

Merge pull request #18395 from davelopez/24.1_fix_filesources_subfolder_pagination

[24.1] Reset current page when browsing sub-folders in FilesSources
parents ab533b6c 03001d4d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -409,6 +409,7 @@ onMounted(() => {
        :is-busy="isBusy"
        :items="items"
        :items-provider="itemsProvider"
        :provider-url="currentDirectory?.url"
        :total-items="totalItems"
        :modal-show="modalShow"
        :modal-static="modalStatic"
+12 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ interface Props {
    isEncoded?: boolean;
    items?: SelectionItem[];
    itemsProvider?: ItemsProvider;
    providerUrl?: string;
    totalItems?: number;
    leafIcon?: string;
    modalShow?: boolean;
@@ -48,6 +49,7 @@ const props = withDefaults(defineProps<Props>(), {
    isEncoded: false,
    items: () => [],
    itemsProvider: undefined,
    providerUrl: undefined,
    totalItems: 0,
    leafIcon: "fa fa-file-o",
    modalShow: true,
@@ -127,6 +129,16 @@ watch(
        filtered(props.items);
    }
);

watch(
    () => props.providerUrl,
    () => {
        // We need to reset the current page when drilling down sub-folders
        if (props.itemsProvider !== undefined) {
            currentPage.value = 1;
        }
    }
);
</script>

<template>