Skip to content

Commit

Permalink
fix: add needRemoveScroll prop
Browse files Browse the repository at this point in the history
  • Loading branch information
nachozullo committed Apr 15, 2024
1 parent bf032f2 commit ed3b10b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/react/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Nimbus is an open-source Design System created by Tiendanube / Nuvesmhop’s tea
### 🐛 Bug fixes

- Added `RemoveScroll` component from `react-remove-scroll` library to prevent scroll resetting on the body of the `Sidebar` component. ([#233](https://github.com/TiendaNube/nimbus-design-system/pull/233) by [@juanchigallego](https://github.com/juanchigallego))
- Added `needRemoveScroll` optional prop to `Sidebar` component. ([#233](https://github.com/TiendaNube/nimbus-design-system/pull/233) by [@juanchigallego](https://github.com/juanchigallego))
- Fixed type bug on expected icon and text color values on `Toast` component. ([#233](https://github.com/TiendaNube/nimbus-design-system/pull/233) by [@juanchigallego](https://github.com/juanchigallego))

### 📚 3rd party library updates
Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nimbus-ds/components",
"version": "5.5.2-rc.3",
"version": "5.5.2-rc.7",
"license": "MIT",
"main": "dist/index.js",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/composite/Sidebar/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nimbus-ds/sidebar",
"version": "3.2.3-rc.5",
"version": "3.3.0-rc.2",
"license": "MIT",
"main": "dist/index.js",
"files": [
Expand Down
7 changes: 6 additions & 1 deletion packages/react/src/composite/Sidebar/src/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const Sidebar: React.FC<SidebarProps> & SidebarComponents = ({
position = "right",
maxWidth = "375px",
open = false,
needRemoveScroll = false,
children,
onRemove,
...rest
Expand Down Expand Up @@ -61,7 +62,11 @@ const Sidebar: React.FC<SidebarProps> & SidebarComponents = ({
open && sidebar.classnames.isVisible,
].join(" ")}
>
<RemoveScroll>{children}</RemoveScroll>
{needRemoveScroll ? (
<RemoveScroll>{children}</RemoveScroll>
) : (
children
)}
</div>
</FloatingFocusManager>
</FloatingOverlay>
Expand Down
5 changes: 5 additions & 0 deletions packages/react/src/composite/Sidebar/src/sidebar.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ export interface SidebarProperties extends SidebarSprinkle {
* @default true
*/
open?: boolean;
/**
* Determines if RemoveScroll wraps sidebar's children component.
* @default true
*/
needRemoveScroll?: boolean;
}

export type SidebarProps = SidebarProperties & HTMLAttributes<HTMLDivElement>;

0 comments on commit ed3b10b

Please sign in to comment.