From fcb36c628f5c9b3aa4c6832a69f44a2456bb2a52 Mon Sep 17 00:00:00 2001 From: qubis741 Date: Wed, 6 Jul 2022 12:10:56 +0200 Subject: [PATCH 1/2] made handleShowScrollShadow optional --- src/components/dialog/Body.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/dialog/Body.tsx b/src/components/dialog/Body.tsx index a2cb3c168..5c949c296 100644 --- a/src/components/dialog/Body.tsx +++ b/src/components/dialog/Body.tsx @@ -9,7 +9,7 @@ export interface BodyProps extends Omit { 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 = forwardRef( @@ -23,7 +23,8 @@ const Body: GenericComponent = forwardRef( return; } const element = event.target as HTMLDivElement; - handleShowScrollShadow(element.scrollHeight - element.scrollTop === element.clientHeight); + handleShowScrollShadow && + handleShowScrollShadow(element.scrollHeight - element.scrollTop === element.clientHeight); }; return ( From 81959c754d147e63107d644163a8fc0b0cecbf9f Mon Sep 17 00:00:00 2001 From: qubis741 Date: Wed, 6 Jul 2022 12:15:26 +0200 Subject: [PATCH 2/2] updated changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 11e46bdc8..45302d93d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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