Skip to content

Commit

Permalink
fix(blade): bottomsheet body scroll lock not clearing (#2403)
Browse files Browse the repository at this point in the history
* fix(blade): bottomsheet body scroll edge case

* Create tricky-clocks-smoke.md
  • Loading branch information
anuraghazra authored Nov 5, 2024
1 parent 5be1344 commit 421a3a8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/tricky-clocks-smoke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@razorpay/blade": patch
---

fix(blade): bottomsheet body scroll lock not clearing
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ const BottomSheetStackProvider = ({
return stack[0] || null;
}, [stack]);

const addBottomSheetToStack = React.useCallback((id: string) => {
const addBottomSheetToStack = React.useCallback((id?: string) => {
// id can be undefined since useId returns `undefined` on first render,
// if we push undefined to the stack the `removeBottomSheetFromStack` will break
// since it will try to match top of the stack with undefined
if (id === undefined) return;
setStack((prev) => [id, ...prev]);
}, []);

Expand Down

0 comments on commit 421a3a8

Please sign in to comment.