Skip to content
71 changes: 71 additions & 0 deletions .maestro/child-sheets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
appId: com.lodev09.truesheet.expo
---

- launchApp:
clearState: true

- waitForAnimationToEnd:
timeout: 3000

# Expand main sheet
- swipe:
start: "50%, 90%"
end: "50%, 30%"
duration: 500
- waitForAnimationToEnd

# --- BasicSheet: header, footer, detent resize, dismiss ---

- tapOn: "TrueSheet View"
- waitForAnimationToEnd

- assertVisible: "Enter some text..."
- assertVisible: "FOOTER"
- assertVisible: "Add Content"

# Resize detents
- tapOn: "Large"
- waitForAnimationToEnd
- tapOn: "Auto"
- waitForAnimationToEnd

- tapOn: "Dismiss"
- waitForAnimationToEnd
- assertVisible: "True Sheet"

# --- PromptSheet: scrollable, form inputs ---

- scrollUntilVisible:
element: "Prompt"
direction: DOWN
- tapOn: "Prompt"
- waitForAnimationToEnd

- assertVisible: "First name"
- assertVisible: "Last name"
- tapOn: "First name"
- inputText: "John"
- tapOn: "Last name"
- inputText: "Doe"

- scrollUntilVisible:
element: "Dismiss"
direction: DOWN
- tapOn: "Dismiss"
- waitForAnimationToEnd
- assertVisible: "True Sheet"

# --- FlatListSheet: scrollable content ---

- tapOn: "FlatList"
- waitForAnimationToEnd

- assertVisible: "Enter some text..."
- assertVisible: "Item #0"

- scrollUntilVisible:
element: "Item #9"
direction: DOWN
- assertVisible: "Item #9"


44 changes: 44 additions & 0 deletions .maestro/main-sheet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
appId: com.lodev09.truesheet.expo
---

- launchApp:
clearState: true

- waitForAnimationToEnd:
timeout: 3000

# --- initialDetentIndex + dismissible=false ---

# Main sheet auto-presents collapsed (header only)
- assertVisible: "True Sheet"
- assertVisible: "Enter some text..."

# Try to swipe down — main sheet is not dismissible
- swipe:
start: "50%, 90%"
end: "50%, 99%"
duration: 300
- waitForAnimationToEnd
- assertVisible: "True Sheet"

# --- Expand and verify content ---

- swipe:
start: "50%, 90%"
end: "50%, 30%"
duration: 500
- waitForAnimationToEnd

- assertVisible: "TrueSheet View"
- assertVisible: "Prompt"
- assertVisible: "ScrollView"
- assertVisible: "FlatList"

# --- Expand to full, then dismiss ---

- tapOn: "Expand"
- waitForAnimationToEnd
- tapOn: "Dismiss"
- waitForAnimationToEnd

- assertNotVisible: "True Sheet"
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

### 🎉 New features

- **iOS**: Enable synchronous state update for RN 0.82+. ([#505](https://github.com/lodev09/react-native-true-sheet/pull/505) by [@lodev09](https://github.com/lodev09))
- **iOS**: Enable synchronous state update for RN 0.82+. ([#505](https://github.com/lodev09/react-native-true-sheet/pull/505), [#507](https://github.com/lodev09/react-native-true-sheet/pull/507) by [@lodev09](https://github.com/lodev09))
- Added `maxContentWidth` prop to control the maximum width of the sheet content. ([#495](https://github.com/lodev09/react-native-true-sheet/pull/495) by [@lodev09](https://github.com/lodev09))
- Added `anchor` and `anchorOffset` props for side sheet positioning. ([#496](https://github.com/lodev09/react-native-true-sheet/pull/496), [#500](https://github.com/lodev09/react-native-true-sheet/pull/500) by [@lodev09](https://github.com/lodev09))

Expand Down
9 changes: 2 additions & 7 deletions ios/TrueSheetView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -290,16 +290,11 @@ - (void)updateStateWithSize:(CGSize)size {
stateData.containerWidth = static_cast<float>(size.width);
stateData.containerHeight = static_cast<float>(size.height);

// RN 0.82+ processes state updates in the same layout pass (synchronous).
// TODO: Once stable, we can drop native layout constraints in favor of synchronous Yoga layout.
auto updateMode =
#if REACT_NATIVE_VERSION_MINOR >= 82
facebook::react::EventQueue::UpdateMode::unstable_Immediate;
_state->updateState(std::move(stateData), facebook::react::EventQueue::UpdateMode::unstable_Immediate);
#else
facebook::react::EventQueue::UpdateMode::Asynchronous;
_state->updateState(std::move(stateData));
#endif

_state->updateState(std::move(stateData), updateMode);
}

- (void)finalizeUpdates:(RNComponentViewUpdateMask)updateMask {
Expand Down