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

Label is hidden when a multiline TextInput is focused on iOS #4482

Open
ericpoulinnz opened this issue Aug 21, 2024 · 3 comments
Open

Label is hidden when a multiline TextInput is focused on iOS #4482

ericpoulinnz opened this issue Aug 21, 2024 · 3 comments
Labels

Comments

@ericpoulinnz
Copy link

ericpoulinnz commented Aug 21, 2024

Current behaviour

When focusing into a TextInput (at least when mode='flat'), the label disappears. It shows up normally when multiline=false, and this is only a problem on iOS.

Expected behaviour

For the label to be scaled down and shown as usual.

Preview

Screenshot 2024-08-21 at 14 10 38 Screenshot 2024-08-21 at 14 10 44

What have you tried so far?

I've traced the problem down to this code in TextInputFlat.tsx, commenting it out solves the problem.

{!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, **// <-- commenting out this line fixes the issue.**
          left: paddingLeft,
          right: paddingRight,
        },
      ]}
    />
  )}

Your Environment

software version
react-native 0.74.1
react-native-paper 5.12.5
@saadi-ninjasCode
Copy link

saadi-ninjasCode commented Aug 21, 2024

Facing the same issue only with flat mode, while working fine with outlined mode
react-native 0.74.5
react-native-paper 5.12.5

@saadi-ninjasCode
Copy link

@ericpoulinnz if you comment the style for background.
#2799 this issue will re-exist

@ericpoulinnz
Copy link
Author

@ericpoulinnz if you comment the style for background. #2799 this issue will re-exist

@saadi-ninjasCode Yeah obviously not the solution, just illustrating where the issue is happening in the code as far as I can see. Seems like a z-index issue or something.

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

2 participants