Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Made handleShowScrollShadow optional #2263

Merged
merged 2 commits into from
Jul 8, 2022
Merged
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

### Changed

- `Dialog.Body`: made `handleShowScrollShadow` optional ([@qubis741](https://github.com/qubis741)) in [#2263](https://github.com/teamleadercrm/ui/pull/2263))

### Deprecated

### Removed
Expand Down
5 changes: 3 additions & 2 deletions src/components/dialog/Body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface BodyProps extends Omit<BoxProps, 'ref'> {
children?: ReactNode;
/** If true, the content will be scrollable when it exceeds the available height. */
scrollable?: boolean;
handleShowScrollShadow: (show: boolean) => void;
handleShowScrollShadow?: (show: boolean) => void;
}

const Body: GenericComponent<BodyProps> = forwardRef<HTMLElement, BodyProps>(
Expand All @@ -23,7 +23,8 @@ const Body: GenericComponent<BodyProps> = forwardRef<HTMLElement, BodyProps>(
return;
}
const element = event.target as HTMLDivElement;
handleShowScrollShadow(element.scrollHeight - element.scrollTop === element.clientHeight);
handleShowScrollShadow &&
handleShowScrollShadow(element.scrollHeight - element.scrollTop === element.clientHeight);
};
return (
<Box display="flex" flexDirection="column" overflowY="auto" {...rest} ref={ref} onScroll={handleWrapperScroll}>
Expand Down