mirror of
https://github.com/strapi/strapi.git
synced 2025-10-16 10:33:34 +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 hasError = errorAssets || errorFolders;
|
||||
|
||||
const [activeTab, setActiveTab] = React.useState(
|
||||
selectedAssets.length > 0 ? 'selected' : 'browse'
|
||||
);
|
||||
|
||||
if (isLoading) {
|
||||
return (
|
||||
<>
|
||||
@ -253,7 +257,7 @@ export const AssetContent = ({
|
||||
</Modal.Title>
|
||||
</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">
|
||||
<Tabs.List>
|
||||
<Tabs.Trigger value="browse">
|
||||
|
Loading…
x
Reference in New Issue
Block a user