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

Commit

Permalink
Merge pull request #744 from appsmithorg/improve-scrollbar-events-defer
Browse files Browse the repository at this point in the history
feat: Added events and defer prop to ScrollArea
  • Loading branch information
albinAppsmith authored Jun 24, 2024
2 parents 9a89d20 + 4a92d08 commit a692320
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 13 deletions.
5 changes: 5 additions & 0 deletions .changeset/few-experts-live.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@appsmithorg/design-system": patch
---

feat: Added events and defer prop to ScrollArea
5 changes: 0 additions & 5 deletions .changeset/great-pets-develop.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/grumpy-turtles-tan.md

This file was deleted.

12 changes: 12 additions & 0 deletions packages/design-system/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# @appsmithorg/design-system

## 2.1.42

### Patch Changes

- [#740](https://github.com/appsmithorg/design-system/pull/740) [`fb7a979d`](https://github.com/appsmithorg/design-system/commit/fb7a979dc6dde647f8e1778801e117972ffadb26) Thanks [@brayn003](https://github.com/brayn003)! - chore: adding icon for git-repository

## 2.1.41

### Patch Changes

- [#735](https://github.com/appsmithorg/design-system/pull/735) [`56cd05b7`](https://github.com/appsmithorg/design-system/commit/56cd05b764a867a0c2adef0348ebcdbd55214df6) Thanks [@albinAppsmith](https://github.com/albinAppsmith)! - feat: Text wrap fix

## 2.1.40

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/design-system/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@appsmithorg/design-system",
"version": "2.1.40",
"version": "2.1.42",
"description": "This is the package for the design system that powers the Appsmith platform",
"module": "build/index.js",
"types": "build/index.d.ts",
Expand Down
16 changes: 14 additions & 2 deletions packages/design-system/src/ScrollArea/ScrollArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,27 @@ import { ScrollAreaProps } from "./ScrollArea.types";

function ScrollArea(props: ScrollAreaProps) {
const ref = useRef<HTMLDivElement>(null);
const { children, className, options, size = "md", ...rest } = props;
const {
children,
className,
defer,
events,
options,
size = "md",
...rest
} = props;
const defaultOptions: UseOverlayScrollbarsParams["options"] = {
scrollbars: {
theme: "ads-v2-scroll-theme",
autoHide: "scroll",
},
...options,
};
const [initialize] = useOverlayScrollbars({ options: defaultOptions });
const [initialize] = useOverlayScrollbars({
options: defaultOptions,
events,
defer,
});

useEffect(() => {
if (ref.current) initialize(ref.current);
Expand Down
2 changes: 2 additions & 0 deletions packages/design-system/src/ScrollArea/ScrollArea.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ import { Sizes } from "__config__/types";
export interface ScrollAreaProps extends React.HTMLAttributes<HTMLDivElement> {
size?: Extract<Sizes, "sm" | "md">;
options?: UseOverlayScrollbarsParams["options"];
events?: UseOverlayScrollbarsParams["events"];
defer?: UseOverlayScrollbarsParams["defer"];
}

0 comments on commit a692320

Please sign in to comment.