Skip to content

fix: StyleSheet.absoluteFillObject removed in RN85 - #4039

Open
ChrisJamesC wants to merge 1 commit into
wix:masterfrom
ChrisJamesC:fix/absoluteFillObject_removed_in_RN85
Open

fix: StyleSheet.absoluteFillObject removed in RN85#4039
ChrisJamesC wants to merge 1 commit into
wix:masterfrom
ChrisJamesC:fix/absoluteFillObject_removed_in_RN85

Conversation

@ChrisJamesC

@ChrisJamesC ChrisJamesC commented Aug 19, 2026

Copy link
Copy Markdown

Description

React Native 0.85 removed StyleSheet.absoluteFillObject. It was only ever an alias — RN's StyleSheet.js declares absoluteFillObject: absoluteFill, the same frozen object, unchanged back through at least v0.72, v0.76 and v0.79. So this PR is a straight rename with no behaviour change on any supported RN version and no compatibility shim needed.

On RN >= 0.85 the removed export is undefined, so {...StyleSheet.absoluteFillObject} silently evaluates to {}. No crash, no warning, no type error — the style just quietly becomes empty.

The most visible consequence is Modal's backdrop:

// packages/react-native-ui-lib/src/components/modal/index.tsx
touchableOverlay: {
  ...StyleSheet.absoluteFillObject
}

It loses position: 'absolute', its insets and its size, leaving an unpositioned zero-height in-flow view that never receives touches — so onBackgroundPress can never fire. That silently breaks tap-outside-to-dismiss for Dialog and FeatureHighlight, and turns Hint into an undismissable full-screen modal when onBackgroundPress is passed (Hint switches to a Modal automatically via isUsingModal = Boolean(onBackgroundPress && useModal), with useModal defaulting to true). To the user that reads as the whole app freezing. Taps on the hint bubble still work, since onPress is wired directly to its own TouchableOpacity, which makes it present as a selective touch bug.

Two other wide-reaching sites:

  • commons/modifiers.ts backs the absF modifier, so every component and every consumer app using absF silently gets {}.
  • tabController/TabPage.tsx (page: StyleSheet.absoluteFillObject) leaves TabController pages unpositioned.

Scope: 30 occurrences across 25 files — packages/react-native-ui-lib/src (26), packages/uilib-native (2, including HighlighterOverlayView, which FeatureHighlight depends on), the demo app (2), and one docs mention. Every changed line is the identical identifier swap; the diff contains nothing else.

Verified on RN 0.86.2 with react-native-ui-lib 9.1.2 (New Architecture, iOS): applying this exact rename as a Yarn patch restores Dialog's tap-outside-to-dismiss and Hint's onBackgroundPress.

Changelog

Fixed components silently losing their absolute-fill styles on React Native 0.85+, where StyleSheet.absoluteFillObject was removed. Most visibly this restores tap-outside-to-dismiss (onBackgroundPress) for Modal, Dialog, FeatureHighlight and Hint, and repairs the absF modifier.

Additional info

Fixes #3965

One note in the interest of transparency: I wasn't able to run npm run pre-push against a full local setup of this repo. The change is a mechanical identifier rename to an alias of the same object, so no type, snapshot or behaviour change is expected — but please let CI be the judge, and I'm happy to follow up on anything it flags.

React Native 0.85 removed StyleSheet.absoluteFillObject. It was only ever an
alias for StyleSheet.absoluteFill (StyleSheet.js declares
`absoluteFillObject: absoluteFill`, the same frozen object, unchanged back
through at least v0.72), so this is a straight rename with no behaviour change
on any supported RN version.

On RN >= 0.85 the removed export is undefined, so spreading it silently yields
{} - no crash, no warning, no type error. The most visible consequence is
Modal's backdrop (touchableOverlay), which loses its position and size and
therefore never receives touches, so onBackgroundPress can never fire. That
breaks tap-outside-to-dismiss for Dialog and FeatureHighlight, and turns a Hint
with onBackgroundPress into an undismissable full-screen modal.

Also affects the absF modifier (commons/modifiers.ts) and TabController pages.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ChrisJamesC ChrisJamesC changed the title fix/StyleSheet_absoluteFillObject_removed_in_RN85 fix: StyleSheet absoluteFillObject removed in RN85 Aug 19, 2026
@ChrisJamesC ChrisJamesC changed the title fix: StyleSheet absoluteFillObject removed in RN85 fix: StyleSheet.absoluteFillObject removed in RN85 Aug 19, 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.

RN 0.85.0 StyleSheet.absoluteFillObject is removed

1 participant