Skip to content

RN 0.85.0 StyleSheet.absoluteFillObject is removed #3965

Open

Description

@isinuyk

Description

As of RN 0.85 StyleSheet.absoluteFillObject is removed. Please use absoluteFill instead, my animated layour is a bit broken.
https://github.com/facebook/react-native/blob/main/CHANGELOG.md#v0850-rc0

Related to

  • Components
  • Demo
  • Docs
  • Typings

Steps to reproduce

Expected behavior

Actual behavior

More Info

Code snippet



Screenshots/Video

Environment

latest version of all libs

  • React Native version:
  • React Native UI Lib version:

Affected platforms

  • Android
  • iOS
  • Web

Activity

  1. added
    buga bug in one of the components
    on Apr 8, 2026
  2. cameronmurphy commented on Jun 9, 2026

    @cameronmurphy

    +1

  3. solominh commented on Jun 29, 2026

    @solominh

    Just polyfill it for future proof:

    StyleSheet.absoluteFillObject = StyleSheet.absoluteFill
  4. ChrisJamesC commented on Aug 18, 2026

    @ChrisJamesC

    Still present on master (commons/modifiers.ts:460, components/modal/index.tsx:155)
    and in 9.1.2, the current latest.

    Adding a repro and the full scope, because this is easy to under-rate: it silently
    breaks touch handling, not just layout.

    Why it's invisible

    {...StyleSheet.absoluteFillObject} evaluates to {} on RN >= 0.85. No crash, no
    warning, no type error — the style just quietly becomes empty.

    Concrete breakage: the Modal backdrop, and everything built on it

    // src/components/modal/index.tsx:155
    touchableOverlay: {
      ...StyleSheet.absoluteFillObject
    }

    The backdrop ends up with no position: 'absolute', no insets and no dimensions —
    an unpositioned, zero-height, in-flow view. onBackgroundPress can therefore
    never fire.

    • Hint — worst affected. It silently switches to a Modal whenever
      onBackgroundPress is passed (isUsingModal = Boolean(onBackgroundPress && useModal),
      and useModal defaults to true). The hint becomes an undismissable
      full-screen modal
      , so the entire app appears frozen. Taps on the hint bubble
      still work, because onPress is wired directly to its own TouchableOpacity —
      which makes this present as a selective touch/Fabric bug and sends you a very
      long way down the wrong path.
    • Dialog — tap-outside-to-dismiss silently dead.
    • FeatureHighlight — same.

    Minimal repro on RN >= 0.85 — tap outside the white box, the counter never moves:

    <Modal visible transparent onBackgroundPress={() => setTaps(t => t + 1)} onRequestClose={close}>
      <View pointerEvents="box-none" style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}>
        <View style={{backgroundColor: 'white', padding: 24}}>
          <Text>backdrop taps: {taps}</Text>
          <Pressable onPress={close}><Text>close</Text></Pressable>
        </View>
      </View>
    </Modal>

    The same modal written with StyleSheet.absoluteFill on the backdrop works
    correctly, which isolates it to the removed API rather than to anything in RN's
    renderer.

    Scope: 26 occurrences across 20 files

    From the published 9.1.2 tarball:

    commons/modifiers.js                 components/hint/index.js
    components/actionBar/index.js        components/hint/HintOld.js
    components/animatedImage/index.js    components/loaderScreen/index.js
    components/animatedScanner/index.js  components/maskedInput/index.js
    components/avatar/index.js           components/modal/index.js
    components/card/index.js             components/overlay/index.js
    components/colorSwatch/index.js      components/slider/index.js
    components/connectionStatusBar/index.js  components/tabController/TabPage.js
    components/drawer/Swipeable.js       incubator/slider/Track.js
    components/featureHighlight/index.js components/gridView/index.js
    

    Two of these reach much further than the rest:

    • commons/modifiers.js:342 — absoluteFill: StyleSheet.absoluteFillObject backs
      the absF modifier, so every component and every consumer app using absF
      silently gets {}.
    • components/tabController/TabPage.js:85 — page: StyleSheet.absoluteFillObject
      leaves TabController pages unpositioned.

    Fix

    absoluteFillObject was only ever an alias. RN's StyleSheet.js has
    absoluteFillObject: absoluteFill — the same frozen object — unchanged back
    through at least v0.72, v0.76 and v0.79. So a plain rename is safe on every RN
    version this library supports, with no compatibility shim needed:

    - ...StyleSheet.absoluteFillObject
    + ...StyleSheet.absoluteFill

    Verified end to end: renaming all 26 occurrences via a Yarn patch restores
    Dialog's tap-outside-to-dismiss and Hint's onBackgroundPress on RN 0.86.2 /
    react-native-ui-lib 9.1.2.

    Happy to open a PR with the rename if that's useful.

    Note on the polyfill workaround suggested above

    StyleSheet.absoluteFillObject = StyleSheet.absoluteFill does work, but only if it
    executes before any of this library's modules are evaluated — the affected styles
    are all built at module scope via StyleSheet.create. That makes it dependent on
    entry-file import order, and when it fails it fails silently, in the same way as
    the original bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buga bug in one of the components

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions