From 16d7ea06a37235cf6699a87a47ff5f77665e044b Mon Sep 17 00:00:00 2001 From: Martin Guillon Date: Tue, 17 Nov 2026 23:34:45 +0100 Subject: [PATCH 1/2] feat(scroll-view): clipToBounds property on iOS and Android `clipToBounds="false"` lets the content of a scroll view draw over its edges (iOS: `clipsToBounds`, Android: `clipChildren`). It was always clipped on iOS. Co-Authored-By: Claude Sonnet 5.5 --- packages/core/ui/scroll-view/index.android.ts | 6 +++++- packages/core/ui/scroll-view/index.d.ts | 9 +++++++++ packages/core/ui/scroll-view/index.ios.ts | 9 ++++++--- packages/core/ui/scroll-view/scroll-view-common.ts | 8 ++++++++ 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/packages/core/ui/scroll-view/index.android.ts b/packages/core/ui/scroll-view/index.android.ts index 3b273f5436..55c192ab53 100644 --- a/packages/core/ui/scroll-view/index.android.ts +++ b/packages/core/ui/scroll-view/index.android.ts @@ -1,5 +1,5 @@ import type { ScrollEventData } from './scroll-view-common'; -import { ScrollViewBase, scrollBarIndicatorVisibleProperty, isScrollEnabledProperty } from './scroll-view-common'; +import { ScrollViewBase, clipToBoundsProperty, scrollBarIndicatorVisibleProperty, isScrollEnabledProperty } from './scroll-view-common'; import { layout } from '../../utils'; import { isUserInteractionEnabledProperty } from '../core/view'; @@ -54,6 +54,10 @@ export class ScrollView extends ScrollViewBase { this.nativeViewProtected.setScrollEnabled(value); } + [clipToBoundsProperty.setNative](value: boolean) { + this.nativeViewProtected.setClipChildren(value); + } + [isScrollEnabledProperty.getDefault](): boolean { return this.nativeViewProtected.getScrollEnabled(); } diff --git a/packages/core/ui/scroll-view/index.d.ts b/packages/core/ui/scroll-view/index.d.ts index 59aa6dd4b8..e5c21cca20 100644 --- a/packages/core/ui/scroll-view/index.d.ts +++ b/packages/core/ui/scroll-view/index.d.ts @@ -83,6 +83,15 @@ export class ScrollView extends ContentView { */ iosContentInsetAdjustmentBehavior: 'never' | 'automatic' | 'scrollableAxes' | 'always'; + /** + * Whether the content is clipped to the bounds of the scroll view. `false` lets a view of the + * content draw over the edges of the scroll view (an inset page, a view which goes under the safe area). + * + * @default true + * @nsProperty + */ + clipToBounds: boolean; + /** * iOS 26+ only. The scroll edge effect UIKit draws where content scrolls * under a bar, applied to every edge of the native scroll view. diff --git a/packages/core/ui/scroll-view/index.ios.ts b/packages/core/ui/scroll-view/index.ios.ts index ba2fc8c2f8..191a91df6d 100644 --- a/packages/core/ui/scroll-view/index.ios.ts +++ b/packages/core/ui/scroll-view/index.ios.ts @@ -1,5 +1,5 @@ import type { ScrollEventData } from './scroll-view-common'; -import { ScrollViewBase, scrollBarIndicatorVisibleProperty, isScrollEnabledProperty, iosContentInsetAdjustmentBehaviorProperty, iosScrollEdgeEffectProperty } from './scroll-view-common'; +import { ScrollViewBase, clipToBoundsProperty, scrollBarIndicatorVisibleProperty, isScrollEnabledProperty, iosContentInsetAdjustmentBehaviorProperty, iosScrollEdgeEffectProperty } from './scroll-view-common'; import { layout } from '../../utils'; import { SDK_VERSION } from '../../utils/constants'; import { View } from '../core/view'; @@ -84,8 +84,11 @@ export class ScrollView extends ScrollViewBase { if (!this.nativeViewProtected) { return; } - // Always set clipsToBounds for scroll-view - this.nativeViewProtected.clipsToBounds = true; + this.nativeViewProtected.clipsToBounds = this.clipToBounds; + } + + [clipToBoundsProperty.setNative](value: boolean) { + this._setNativeClipToBounds(); } protected attachNative() { diff --git a/packages/core/ui/scroll-view/scroll-view-common.ts b/packages/core/ui/scroll-view/scroll-view-common.ts index 17f2e5c871..4c63878df1 100644 --- a/packages/core/ui/scroll-view/scroll-view-common.ts +++ b/packages/core/ui/scroll-view/scroll-view-common.ts @@ -19,6 +19,7 @@ export abstract class ScrollViewBase extends ContentView { public isScrollEnabled: boolean; public iosContentInsetAdjustmentBehavior: 'never' | 'automatic' | 'scrollableAxes' | 'always'; public iosScrollEdgeEffect: CoreTypes.ScrollEdgeEffectType; + public clipToBounds: boolean; private _addedScrollEvent = false; @@ -129,6 +130,13 @@ export const isScrollEnabledProperty = new Property({ }); isScrollEnabledProperty.register(ScrollViewBase); +export const clipToBoundsProperty = new Property({ + name: 'clipToBounds', + defaultValue: true, + valueConverter: booleanConverter, +}); +clipToBoundsProperty.register(ScrollViewBase); + const insetAdjustmentConverter = makeParser<'never' | 'automatic' | 'scrollableAxes' | 'always'>(makeValidator('never', 'automatic', 'scrollableAxes', 'always')); export const iosContentInsetAdjustmentBehaviorProperty = new Property({ name: 'iosContentInsetAdjustmentBehavior', From 0c8812c4c6ce8da60d870c8c6ff36451d1bb94d0 Mon Sep 17 00:00:00 2001 From: Martin Guillon Date: Tue, 17 Nov 2026 23:55:07 +0100 Subject: [PATCH 2/2] fix(core): do not request a layout from a parent which has none A Span updated while its layout requests were suspended replays the request (requestlayoutIfNeeded): its parent is a FormattedString, which is not a view and has no `requestLayout`, so the request threw "this.parent.requestLayout is not a function". Inside a collection view cell this made the cell provider fail and UIKit asserted on the missing cell. Co-Authored-By: Claude Sonnet 5.5 --- packages/core/ui/core/view-base/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/core/ui/core/view-base/index.ts b/packages/core/ui/core/view-base/index.ts index b25d6e5867..f421d6f6d5 100644 --- a/packages/core/ui/core/view-base/index.ts +++ b/packages/core/ui/core/view-base/index.ts @@ -1049,8 +1049,9 @@ export abstract class ViewBase extends Observable { @profile public requestLayout(): void { // Default implementation for non View instances (like TabViewItem). + // The parent can have no layout to request: the one of a Span is a FormattedString. const parent = this.parent; - if (parent) { + if (typeof parent?.requestLayout === 'function') { this.performLayout(); } }