Skip to content

Commit

Permalink
fix: show field loader when using field overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvxd committed May 30, 2024
1 parent 151a267 commit 8ccfa4c
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions packages/core/components/Puck/components/Fields/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,12 @@ const defaultPageFields: Record<string, Field> = {

const DefaultFields = ({
children,
isLoading,
}: {
children: ReactNode;
isLoading: boolean;
itemSelector?: ItemSelector | null;
}) => {
return (
<div className={getClassName({ isLoading })}>
{children}
{isLoading && (
<div className={getClassName("loadingOverlay")}>
<Loader size="32" />
</div>
)}
</div>
);
return <>{children}</>;
};

type ComponentOrRootData = Omit<Partial<ComponentData<any>>, "type">;
Expand Down Expand Up @@ -286,6 +276,11 @@ export const Fields = () => {
}
})}
</Wrapper>
{isLoading && (
<div className={getClassName("loadingOverlay")}>
<Loader size={32} />
</div>
)}
</form>
);
};

0 comments on commit 8ccfa4c

Please sign in to comment.