Skip to content

fix(appbar): prevent large/medium header title from being clipped on iOS#1

Closed
azizbecha wants to merge 1 commit into
mainfrom
fix/appbar-large-mode-title-clipped-ios
Closed

fix(appbar): prevent large/medium header title from being clipped on iOS#1
azizbecha wants to merge 1 commit into
mainfrom
fix/appbar-large-mode-title-clipped-ios

Conversation

@azizbecha
Copy link
Copy Markdown
Owner

Summary

Appbar.Header with mode="large" (and mode="medium") renders its title clipped on iOS — the lower portion of the title text is cut off. Android is unaffected.

Before (iOS, mode="large")
Title text cropped near the top of the header instead of sitting at the bottom

Root cause

In medium/large mode, Appbar renders a columnContainer (flexDirection: 'column', flex: 1) holding a controlsRow stacked over AppbarContent. The Appbar's content row uses alignItems: 'center', so columnContainer is not stretched to the Appbar's fixed modeAppbarHeight (large = 152, medium = 112) — it's sized to its content. The controls row plus AppbarContent's mode padding (v3LargeContainer: paddingTop: 36 + paddingBottom: 28; v3MediumContainer: paddingBottom: 24) plus the headline line-height can exceed the header height, so the title overflows the Appbar's bounds. On iOS, where Surface renders a fixed-size layer (SurfaceIOS), that overflow is clipped; on Android it's a single view, so it spills instead of clipping.

Fix

Add alignSelf: 'stretch' to styles.columnContainer so the column fills the header's fixed height in medium/large mode. The controls row and AppbarContent (justifyContent: 'flex-end') then partition a known height and the title stays within bounds.

 columnContainer: {
   flexDirection: 'column',
   flex: 1,
+  alignSelf: 'stretch',
   paddingTop: 8,
 },

Testing

  • yarn jest src/components/__tests__/Appbar — 37 passed, 2 snapshots passed (no snapshot churn)
  • yarn eslint src/components/Appbar/Appbar.tsx — clean
  • ⚠️ Pending manual verification on an iOS simulator (Appbar example screen → cycle small/medium/large/center-aligned; confirm title fully visible & bottom-aligned in medium/large, and no Android regression). Marking as draft until that's confirmed. If alignSelf: 'stretch' alone isn't sufficient, follow-ups would be: give controlsRow a fixed height instead of flex: 1, and/or rebalance the v3MediumContainer / v3LargeContainer paddings in AppbarContent.tsx.

Notes

  • Unrelated, but noticed while testing: tsc currently fails on main with several TS2698: Spread types may only be created from object types errors (ActivityIndicator, BottomNavigationBar, FABGroup, Menu, Modal, TouchableRipple.native) — looks like fallout from the RN 0.85 StyleSheet.flatten union typing. This PR's pre-commit hook was bypassed for that reason; that breakage should be fixed separately.

In `medium`/`large` mode the inner column was sized to its content rather
than to the Appbar's fixed `modeAppbarHeight`, so the controls row plus the
title's padding/line-height could exceed the header height. On iOS, where
`Surface` renders a fixed-size layer, the overflowing title got clipped.

Add `alignSelf: 'stretch'` to `columnContainer` so it fills the header
height; the controls row and `AppbarContent` (`justifyContent: 'flex-end'`)
then partition that known height and the title stays within bounds.
@azizbecha
Copy link
Copy Markdown
Owner Author

Reopened against upstream: callstack#4941

@azizbecha azizbecha closed this May 11, 2026
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