Skip to content

Support react native 0.85 #116

Closed
Closed

Description

@faljabi

Describe the bug
React native deprecated absoluteFillObject

To Reproduce
Steps to reproduce the behavior:

  1. Upgrade to rn 0.85
  2. OTP containers are getting close to each other when it is filled

Expected behavior
OTP containers should remain the same position

Additional context
I patched it with the below for now.

diff --git a/node_modules/react-native-otp-entry/dist/OtpInput/OtpInput.styles.js b/node_modules/react-native-otp-entry/dist/OtpInput/OtpInput.styles.js
index 115c729..9073662 100644
--- a/node_modules/react-native-otp-entry/dist/OtpInput/OtpInput.styles.js
+++ b/node_modules/react-native-otp-entry/dist/OtpInput/OtpInput.styles.js
@@ -21,7 +21,7 @@ exports.styles = react_native_1.StyleSheet.create({
         fontSize: 28,
     },
     hiddenInput: {
-        ...react_native_1.StyleSheet.absoluteFillObject,
+        ...react_native_1.StyleSheet.absoluteFill,
         ...react_native_1.Platform.select({
             ios: {
                 opacity: 0.02,

Activity

  1. kishan-somaiya25 commented on Apr 24, 2026

    @kishan-somaiya25

    I'm facing the same issue, any timeline for fixing this? @anday013

  2. anday013 commented on Apr 25, 2026

    @anday013
    Owner

    Thank you for reporting! Please check if the PR #117 solves your issue?

  3. ArturBuja commented on May 15, 2026

    @ArturBuja

    @anday013 Could you merge that PR?

  4. kishan-somaiya25 commented on May 28, 2026

    @kishan-somaiya25

    @anday013 Thanks for the update,

    Tested this patch — works correctly on RN 0.85. The migration from absoluteFillObject spread to StyleSheet.absoluteFill in the style array is the right approach and maintains identical behaviour. Style precedence in the array is correct (fill → hiddenInput → user overrides).

    We're currently using this via patch-package while waiting for a release:

    diff --git a/node_modules/react-native-otp-entry/dist/OtpInput/OtpInput.js b/node_modules/react-native-otp-entry/dist/OtpInput/OtpInput.js
    -        React.createElement(react_native_1.TextInput, { ...textInputProps, style: [OtpInput_styles_1.styles.hiddenInput, textInputProps?.style] })));
    +        React.createElement(react_native_1.TextInput, { ...textInputProps, style: [react_native_1.StyleSheet.absoluteFill, OtpInput_styles_1.styles.hiddenInput, textInputProps?.style] })));
    
    diff --git a/node_modules/react-native-otp-entry/dist/OtpInput/OtpInput.styles.js b/node_modules/react-native-otp-entry/dist/OtpInput/OtpInput.styles.js
        hiddenInput: {
    -        ...react_native_1.StyleSheet.absoluteFillObject,
             ...react_native_1.Platform.select({

    One small suggestion for completeness: the fix is applied to dist/ directly — ideally the source files in src/ should be updated too and dist/ regenerated via the build step, so the source of truth stays in TypeScript. But if you're comfortable with the current approach, this is safe to merge.

    Hopefully this MR lands soon!

  5. anday013 commented on Jun 11, 2026

    @anday013
    Owner

    fixed in v1.8.6

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

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions