Skip to content

fix: resolve review comments on Drawer native implementation - #3754

Draft
rzp-slash-public[bot] wants to merge 16 commits into
masterfrom
fix/drawer-review-comments
Draft

fix: resolve review comments on Drawer native implementation#3754
rzp-slash-public[bot] wants to merge 16 commits into
masterfrom
fix/drawer-review-comments

Conversation

@rzp-slash-public

Copy link
Copy Markdown
Contributor

Summary

Resolves the following review comments from PR #3645:

  1. [MAJOR] onExitComplete stale closure (AnimatedDrawerContainer.native.tsx): Stored onExitComplete in a ref (onExitCompleteRef) so the reanimated withTiming callback always invokes the latest identity without re-triggering the animation.

  2. [MINOR] screenWidth stale on rotation/resize (AnimatedDrawerContainer.native.tsx): Replaced Dimensions.get('window').width with the reactive useWindowDimensions() hook so screenWidth updates on device rotation or multitasking resize.

  3. [MINOR] z-index useEffect missing stackingLevel dep (Drawer.native.tsx): Added stackingLevel to the dependency array of the z-index useEffect so the z-index updates when the drawer stack changes.

  4. [MINOR] HSL color parsing guard (DrawerSubcomponents.native.tsx): Guarded the opaqueColor transform so the hsla to hsl + alpha removal only applies when the regex match succeeds; otherwise subtleColor is used as-is.

  5. [MINOR] Native Drawer missing forwardRef (Drawer.native.tsx): Wrapped _Drawer in React.forwardRef and attached the ref to AnimatedDrawerContainer's StyledDrawerWrapper, matching the web component's ref forwarding pattern.

[resolved by agent]

Generated with Claude Code

Co-authored-by: admin

rohitr-raz and others added 16 commits July 3, 2026 11:02
Implements .native.tsx files for the Drawer component, replacing the stub
implementations with real native rendering using styled-components/native
and react-native-reanimated.

- Add AnimatedDrawerContainer.native.tsx (reanimated slide-in/overlay)
- Implement Drawer.native.tsx via conditional @gorhom/portal mount
  (mirrors the working Popover/Tooltip native pattern)
- Implement DrawerSubcomponents.native.tsx (header/body)
- Register a BladeBottomSheetPortal PortalHost in the RN Storybook preview
  so portal-based components render in Storybook, and add flex:1 sizing
- Fix invalid bare string children in Drawer.stories.tsx (native crash)
- Add native tests + snapshot

Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
- Remove empty noop arrow function, guard onExitComplete call directly
- Rename unused isLazy to ignoredIsLazy to satisfy no-unused-vars rule

Co-authored-by: admin <admin>
…een width [resolved by agent]

Co-authored-by: admin <admin>
- Initialize the surface shared values at the closed/off-screen state so the
  slide-in has a frame to animate from (enter was snapping into place)
- Mirror web's Drawer transition timings (xmoderate/entrance, moderate/exit)
- Use Dimensions.get for screen width and a noop exit callback fallback
- Refine DrawerSubcomponents native layout and update the Drawer stories
- Regenerate Drawer native snapshots

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: admin <admin>
- Add closeButtonRef useRef and include it in DrawerContext
- Fall back to closeButtonRef when focusing on open
- Honor isLazy: initialize isMounted with isOpen || !isLazy
- Guard onUnmount behind hasEverOpenedRef
- Update isLazy test for web parity
… typo [resolved by agent]

Co-authored-by: admin <admin>
Resolve comment conflict in RN Storybook preview to mention both Drawer and BottomSheet portal content.

Co-authored-by: Cursor <cursoragent@cursor.com>
Resolve Storybook preview comment conflict keeping Drawer, BottomSheet, and DatePicker mentions.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	packages/blade/.storybook/react-native/preview.tsx
@changeset-bot

changeset-bot Bot commented Jul 15, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5b39742

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@razorpay/blade Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant