mirror of
https://github.com/strapi/strapi.git
synced 2025-10-19 20:11:06 +00:00
fix(upload): switching tab when updating pagination
This commit is contained in:
parent
1177bc96df
commit
2f28b9dcef
@ -146,6 +146,10 @@ export const AssetContent = ({
|
|||||||
const isLoading = isLoadingPermissions || isLoadingAssets || isLoadingFolders;
|
const isLoading = isLoadingPermissions || isLoadingAssets || isLoadingFolders;
|
||||||
const hasError = errorAssets || errorFolders;
|
const hasError = errorAssets || errorFolders;
|
||||||
|
|
||||||
|
const [activeTab, setActiveTab] = React.useState(
|
||||||
|
selectedAssets.length > 0 ? 'selected' : 'browse'
|
||||||
|
);
|
||||||
|
|
||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@ -253,7 +257,7 @@ export const AssetContent = ({
|
|||||||
</Modal.Title>
|
</Modal.Title>
|
||||||
</Modal.Header>
|
</Modal.Header>
|
||||||
|
|
||||||
<TabsRoot variant="simple" defaultValue={selectedAssets.length > 0 ? 'selected' : 'browse'}>
|
<TabsRoot variant="simple" value={activeTab} onValueChange={setActiveTab}>
|
||||||
<Flex paddingLeft={8} paddingRight={8} paddingTop={6} justifyContent="space-between">
|
<Flex paddingLeft={8} paddingRight={8} paddingTop={6} justifyContent="space-between">
|
||||||
<Tabs.List>
|
<Tabs.List>
|
||||||
<Tabs.Trigger value="browse">
|
<Tabs.Trigger value="browse">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user