fix: StyleSheet.absoluteFillObject removed in RN85 - #4039
Open
ChrisJamesC wants to merge 1 commit into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
React Native 0.85 removed
StyleSheet.absoluteFillObject. It was only ever an alias — RN'sStyleSheet.jsdeclaresabsoluteFillObject: 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:It loses
position: 'absolute', its insets and its size, leaving an unpositioned zero-height in-flow view that never receives touches — soonBackgroundPresscan never fire. That silently breaks tap-outside-to-dismiss forDialogandFeatureHighlight, and turnsHintinto an undismissable full-screen modal whenonBackgroundPressis passed (Hintswitches to aModalautomatically viaisUsingModal = Boolean(onBackgroundPress && useModal), withuseModaldefaulting totrue). To the user that reads as the whole app freezing. Taps on the hint bubble still work, sinceonPressis wired directly to its ownTouchableOpacity, which makes it present as a selective touch bug.Two other wide-reaching sites:
commons/modifiers.tsbacks theabsFmodifier, so every component and every consumer app usingabsFsilently 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, includingHighlighterOverlayView, whichFeatureHighlightdepends 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 andHint'sonBackgroundPress.Changelog
Fixed components silently losing their absolute-fill styles on React Native 0.85+, where
StyleSheet.absoluteFillObjectwas removed. Most visibly this restores tap-outside-to-dismiss (onBackgroundPress) forModal,Dialog,FeatureHighlightandHint, and repairs theabsFmodifier.Additional info
Fixes #3965
One note in the interest of transparency: I wasn't able to run
npm run pre-pushagainst 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.