Skip to content

feat: overlay opacity, tap-outside flag, inline snap points and footer presentation - #6

Merged
sergeymild merged 11 commits into
mainfrom
feat/overlay-and-snap
Sep 29, 2026
Merged

sergeymild merged 11 commits into
mainfrom
feat/overlay-and-snap

Conversation

@sergeymild

Copy link
Copy Markdown
Owner

New sheet params to replace @gorhom/bottom-sheet in the MuseScore app:

  • dismissOnOverlayTap — tap on the background dismisses the sheet independently of swipe (defaults to dismissable).
  • overlayOpacity — background dim; 0 with useInlinePresentation removes it and passes touches outside the card to the screen behind.
  • collapsedHeight — lower snap point for inline sheets; the sheet opens there and drags up to its full height.
  • presentationStyle: 'footer' — inline host pinned to the bottom of the screen above inline sheets (buy buttons, full-screen overlays).

Fixes found while migrating:

  • The sheet placeholder never takes touches (it covered headers above inline sheets).
  • iOS: inline sheets mounted outside an RN surface keep their own touch handler; with a transparent overlay only touches outside the card pass through.
  • Android: keyboard is hidden when an inline sheet with a focused input is dismissed; touches outside inline sheets reach RN views behind.
  • No dismiss command is sent while unmounting (it crashed Fabric on iOS); Android drops the sheet together with its view.

Also includes #5.

Version 7.12.0.

SergeyMild added 11 commits September 16, 2026 11:21
…ributed

The crashes worth chasing name nothing of ours on Android: "addViewAt: failed to
insert view [child] into parent [parent] at index N", caused by
"IndexOutOfBoundsException: index=N count=0", with a stack made only of React
Native and framework frames. On iOS the symbols are ours
(HostFittedSheet.setFittedSheetParams, dismissSheet inside
RCTMountingManager.performTransaction) but the state that led there is not.

So the library says it itself. SheetTreeLog records every place where a view
React Native believes it owns is moved by us, naming views the way the crash
report names them - by the React tag on Android, by tag and address on iOS:

  host.addView          the previous child is dropped without React Native hearing
  host.removeView / host.removeViewAt
  sheet.addView         an overlay child never reaches mHostView, yet
                        getChildCount goes on counting it
  sheet.removeView / sheet.removeViewAt
  sheet.detachHost      the host leaves the dialog container on dismiss
  inline.attachOverlay / dialog.attachOverlay
                        the overlay is re-parented out of whatever parent React
                        Native gave it
  sheet.insertReactSubview / sheet.removeReactSubview / sheet.attachOverlay /
  sheet.destroy         the same on iOS
  host.mountChild / host.unmountChild / host.prepareForRecycle
                        what the mounting layer asked for, and where the
                        HostFittedSheet is thrown away and rebuilt

Entries go to logcat under Sheet2Tree and to the unified log under com.sheet2,
to a 32-entry ring, and on Android to JS as a "sheet2:tree" event.
addSheetTreeListener turns them into app breadcrumbs - which is what survives
into a native crash report - and getSheetTreeLog() reads the ring, the only
channel iOS has for now.

Nothing changes in behaviour: the same views are moved the same way. The two
leftover println("😀 ...") debug lines go with it.
…ter presentation; own touches outside RN surfaces
@sergeymild
sergeymild merged commit d3b2e3d into main Sep 29, 2026
0 of 5 checks passed
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