fix(mobile): render DrawerPortal inside BottomSheetModalProvider so comment kebab opens#14391
Merged
Merged
Conversation
…omment kebab opens @gorhom/bottom-sheet's BottomSheetModalProvider wraps its children in its own nested PortalProvider with an isolated host registry. @gorhom/portal resolves a Portal's hostName against the nearest provider only — it doesn't walk up. With the DrawerPortal host registered as a sibling of BottomSheetModalProvider, every <Portal hostName='DrawerPortal'> rendered from inside a bottom sheet (e.g. the kebab on a comment row, or the track-owner overflow in CommentDrawerHeader) resolved through the inner provider, found nothing, and silently rendered nowhere. The press fired, state updated, but the action drawer never appeared. Moving the host inside BottomSheetModalProvider puts it in the same registry the inner Portals look up, so the action drawer renders correctly. External callers (e.g. ContestCommentsList outside any bottom sheet) still resolve it through the same provider chain. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The kebab overflow menu on a comment in the mobile Comment Drawer wasn't opening — tapping it did nothing. This is a follow-up to #14385 which removed a redundant
CommentSectionProviderwrap but didn't actually fix the user-facing bug.Root cause
@gorhom/bottom-sheet'sBottomSheetModalProviderwraps its children in its own nested<PortalProvider rootHostName='bottom-sheet-portal-XXX'>with an isolated host registry.@gorhom/portalresolves a Portal'shostNameagainst the nearestPortalProvideronly — it does not walk up to outer providers.With the
DrawerPortalhost registered as a sibling ofBottomSheetModalProvider, any<Portal hostName='DrawerPortal'>rendered from inside a bottom sheet (the kebab on a comment row, or the track-owner overflow inCommentDrawerHeader) resolved through the inner provider, found noDrawerPortalhost, and silently rendered nowhere.onPressfired, state updated, but the action drawer never appeared.Fix
Move
<PortalHost name='DrawerPortal' />from outsideBottomSheetModalProviderto inside it (alongsideChatReactionsPortal). Now it's registered in the same registry the inner Portals look up. External callers (e.g.ContestCommentsListoutside any bottom sheet) still find it through the same provider chain because there's only onePortalProviderbetween them and the host.Test plan
ContestCommentsListkebab still works (caller outside any bottom sheet)CommentDrawerHeaderstill works (sameDrawerPortalhost)🤖 Generated with Claude Code