Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions resources/ios/NativeUITransitionFunctions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import UIKit
// PHP signals an inter-screen transition via:
// nativephp_call('NativeUI.Transition.Set', json_encode(['type' => 'slide_from_right']));
//
// `view_transition` additionally morphs elements sharing a `transition-name`
// across the swap; the mapping and the morph both live in core.
//
// The Set handler stages `pendingTransition` + `navigationPending` on the
// shared NativeUIBridge. The next nativephp_element_publish() flips
// `screenKey`, which causes SwiftUI to remount the tree renderer with
Expand All @@ -24,6 +27,11 @@ enum NativeUITransitionFunctions {
// core (`nativeScreenTransition(for:)`), so this staging point is
// where the substitution happens — "none" is left untouched since
// it's already motionless.
// Reduce Motion also catches `view_transition`: substituting a
// plain fade drops the shared-element morph along with the
// directional motion, since the morph IS the movement that
// setting asks us not to make. `none` and `fade` are already
// motionless and pass through untouched.
let type = (UIAccessibility.isReduceMotionEnabled && requested != "none" && requested != "fade")
? "fade"
: requested
Expand Down
Loading