Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiline TextInput backgroundColor does not fully cover surface #4469

Open
donutdonate opened this issue Jul 30, 2024 · 3 comments
Open

Multiline TextInput backgroundColor does not fully cover surface #4469

donutdonate opened this issue Jul 30, 2024 · 3 comments
Labels

Comments

@donutdonate
Copy link

donutdonate commented Jul 30, 2024

Current behaviour

Multiline TextInput background color does not cover all the surface on iOS if background color have opacity.

Expected behaviour

Multiline TextInput background color should cover all the surface on iOS.

How to reproduce?

https://snack.expo.dev/@konstantin_bonn/textinput

Preview

Снимок экрана 2024-07-30 в 17 16 33

What have you tried so far?

Try to apply contentStyle with the same color, but it just got worse.
Works fine if comment background in this workaround for iOS

{!isAndroid && multiline && !!label && !disabled && (
          // Workaround for: https://github.com/callstack/react-native-paper/issues/2799
          // Patch for a multiline TextInput with fixed height, which allow to avoid covering input label with its value.
          <View
            testID="patch-container"
            pointerEvents="none"
            style={[
              StyleSheet.absoluteFill,
              dense ? styles.densePatchContainer : styles.patchContainer,
              {
                // backgroundColor:
                //   viewStyle.backgroundColor || containerStyle.backgroundColor,
                left: paddingLeft,
                right: paddingRight,
              },
            ]}
          />
        )}

Your Environment

software version
ios 17.2
react-native "0.73.6"
react-native-paper "^5.12.3"
node v20.5.0
yarn 1.22.19
@iM-GeeKy
Copy link

iM-GeeKy commented Aug 1, 2024

@lukewalczak I'm facing the same with the latest version of paper using mulitline. Here is the patch mentioned above by @donutdonate that seems to resolve the issue, in case anyone needs it.

diff --git a/node_modules/react-native-paper/src/components/TextInput/TextInputFlat.tsx b/node_modules/react-native-paper/src/components/TextInput/TextInputFlat.tsx
index 8a0dcb1..583c656 100644
--- a/node_modules/react-native-paper/src/components/TextInput/TextInputFlat.tsx
+++ b/node_modules/react-native-paper/src/components/TextInput/TextInputFlat.tsx
@@ -363,8 +363,8 @@ const TextInputFlat = ({
               StyleSheet.absoluteFill,
               dense ? styles.densePatchContainer : styles.patchContainer,
               {
-                backgroundColor:
-                  viewStyle.backgroundColor || containerStyle.backgroundColor,
+                // backgroundColor:
+                //   viewStyle.backgroundColor || containerStyle.backgroundColor,
                 left: paddingLeft,
                 right: paddingRight,
               },

@iM-GeeKy
Copy link

iM-GeeKy commented Aug 2, 2024

@lukewalczak The above patch seems to work on simulator, but appears to not work when deployed to a standalone build.
Screenshot 2024-08-02 at 8 51 07 AM
I suppose I could revert back to a version where this wasn't an issue (for me that is 5.12.3, but it would be nice to find a resolution for this as it is the only defect preventing me from releasing the next version of my app.

@ericpoulinnz
Copy link

#4482 looks to be caused by the same block of code mentioned in this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants