react-native icon indicating copy to clipboard operation
react-native copied to clipboard

UI problem with iOS floating keyboard in iPad.

Open gkasireddy202 opened this issue 4 months ago • 9 comments

Description

Issue with TextInput return type "Done" on iPad using Floating keyboard

Steps to reproduce

  1. Focus on Textinput.
  2. Click on the Done button.
  3. The login button has disappeared.

React Native Version

0.73.2

Affected Platforms

Runtime - iOS

Output of npx react-native info

OS: macOS 14.2.1
  CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
  Memory: 507.06 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 19.8.1
    path: /usr/local/bin/node
  Yarn: Not Found
  npm:
    version: 6.14.18
    path: ~/Documents/Projects//Mobile/Myapp/node_modules/.bin/npm
  Watchman:
    version: 2023.03.13.00
    path: /usr/local/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/gopi/.rvm/gems/ruby-2.7.6/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.2
      - iOS 17.2
      - macOS 14.2
      - tvOS 17.2
      - watchOS 10.2
  Android SDK:
    API Levels:
      - "23"
      - "24"
      - "25"
      - "26"
      - "27"
      - "28"
      - "29"
      - "30"
      - "31"
      - "32"
      - "33"
    Build Tools:
      - 28.0.3
      - 29.0.2
      - 30.0.2
      - 30.0.3
      - 31.0.0
      - 32.0.0
      - 32.1.0
      - 33.0.0
    System Images:
      - android-29 | Google APIs Intel x86 Atom
      - android-29 | Google Play Intel x86 Atom
      - android-30 | Google APIs Intel x86 Atom
      - android-32 | Google APIs Intel x86 Atom_64
      - android-32 | Google Play Intel x86 Atom_64
      - android-33 | Google APIs Intel x86 Atom_64
      - android-33 | Google Play Intel x86 Atom_64
    Android NDK: Not Found
IDEs:
  Android Studio: 2021.2 AI-212.5712.43.2112.8609683
  Xcode:
    version: 15.1/15C65
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 11.0.15
    path: /usr/bin/javac
  Ruby:
    version: 2.7.6
    path: /Users/gopi/.rvm/rubies/ruby-2.7.6/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.2
    wanted: 0.73.2
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: false

Stacktrace or Logs

import React, { Component } from 'react';
import { View, TextInput, Button, KeyboardAvoidingView, StyleSheet } from 'react-native';

class Loginpage extends Component {
  state = {
    username: '',
    password: '',
  };

  handleUsernameChange = (username) => {
    this.setState({ username });
  };

  handlePasswordChange = (password) => {
    this.setState({ password });
  };

  handleLogin = () => {
    const { username, password } = this.state;
    // Add your login logic here
    console.log('Username:', username);
    console.log('Password:', password);
  };

  render() {
    return (
      <KeyboardAvoidingView style={styles.container} behavior="padding">
        <View style={styles.inputContainer}>
          <TextInput
            style={styles.input}
            placeholder="Username"
            onChangeText={this.handleUsernameChange}
            value={this.state.username}
            autoCapitalize="none"
          />
          <TextInput
            style={styles.input}
            placeholder="Email"
            onChangeText={this.handleUsernameChange}
            value={this.state.username}
            autoCapitalize="none"
          />
          <TextInput
            style={styles.input}
            placeholder="Phone"
            onChangeText={this.handleUsernameChange}
            value={this.state.username}
            autoCapitalize="none"
          />
           <TextInput
            style={styles.input}
            placeholder="Password"
            onChangeText={this.handlePasswordChange}
            value={this.state.password}
            returnKeyType='done'
            secureTextEntry
          />
          <Button title="Login" onPress={this.handleLogin} />
        </View>
      </KeyboardAvoidingView>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#fff',
  },
  inputContainer: {
    width: '80%',
  },
  input: {
    height: 40,
    borderColor: 'gray',
    borderWidth: 1,
    marginBottom: 20,
    paddingLeft: 10,
  },
});

export default Loginpage;

Reproducer

No Git url

Screenshots and Videos

https://github.com/facebook/react-native/assets/90603484/1d809d14-4280-4692-897d-eb40287637de

gkasireddy202 avatar Apr 13 '24 05:04 gkasireddy202

:warning: Missing Reproducible Example
:information_source: We could not detect a reproducible example in your issue report. Please provide either:
  • If your bug is UI related: a Snack
  • If your bug is build/update related: use our Reproducer Template. A reproducer needs to be in a GitHub repository under your username.

github-actions[bot] avatar Apr 13 '24 05:04 github-actions[bot]

:warning: Newer Version of React Native is Available!
:information_source: You are on a supported minor version, but it looks like there's a newer patch available - 0.73.6. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.

github-actions[bot] avatar Apr 13 '24 05:04 github-actions[bot]

Please look in the react-native:0.73.2 because we recently upgraded my project to 0.73.2

gkasireddy202 avatar Apr 13 '24 05:04 gkasireddy202

this is a known issue with KeyboardAvoidingView, since both iOS and android doesn't have any official api to detect floating keyboard there is no official solution in RN as well, in iOS you can use workaround from #29473 comment for now

netmaxt3r avatar Apr 14 '24 18:04 netmaxt3r

@netmaxt3r - Thanks for your reply. We have 20 - 30 screens in my project. We need to add the condition to KeyboardAvoidingView for every screen any other solution, please?

gkasireddy202 avatar Apr 15 '24 04:04 gkasireddy202

Please check the sample repo for this issue. react-native:0.73.7 https://github.com/gopikrishnacse55/UIExample

https://github.com/facebook/react-native/assets/25631385/75a0db4a-830e-4801-b3d4-1bec81ccb080

gopikrishnacse55 avatar Apr 21 '24 04:04 gopikrishnacse55

Hi, Any update on this issue?

gkasireddy202 avatar Apr 25 '24 05:04 gkasireddy202

Any update on this issue?

gkasireddy202 avatar May 02 '24 06:05 gkasireddy202

Please update on this. I provided a repo also.

gkasireddy202 avatar May 09 '24 13:05 gkasireddy202