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 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 (