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

Android platform showSoftInputOnFocus not work well #26643

Closed
afishhhhh opened this issue Sep 30, 2019 · 3 comments
Closed

Android platform showSoftInputOnFocus not work well #26643

afishhhhh opened this issue Sep 30, 2019 · 3 comments
Labels
Bug Platform: Android Android applications. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@afishhhhh
Copy link

afishhhhh commented Sep 30, 2019

There are some TextInput in my code. One of them I set showSoftInputOnFocus to true, others to false. I want the soft keyboard to be displayed when remark TextInput focused, hidden when other TextInput focused.

<View>
  <View>
    <Text>体积(volume)</Text>
    <TextInput
      value={volume}
      showSoftInputOnFocus={false}
      keyboardType="numeric"
      onChangeText={text => this.setState({ volume: +text })}
    />
    <Text style={styles.unit}>m<Text style={styles.sup}>3</Text></Text>
  </View>
  <View>
    <Text>重量(weight)</Text>
    <TextInput
      value={weight}
      showSoftInputOnFocus={false}
      keyboardType="numeric"
      onChangeText={text => this.setState({ weight: +text })}
    />
    <Text style={styles.unit}>kg</Text>
  </View>
</View>
<View>
  <Text>备注(remark)</Text>
  <TextInput
    value={remark}
    showSoftInputOnFocus={true}
    onChangeText={text => this.setState({ remark: text })}
  />
</View>

When I make remark TextInput focused, then make other TextInput focused, the keyboard doesn't hide. Like this:

Step 1:
Screenshot_1569824767

Step 2:
Screenshot_1569824793

I don't think the soft keyboard should be displayed when volume TextInput and weight TextInput focused, but it does.

React Native version:

  • OS: macOS 10.14.6
  • react: 16.9.0 => 16.9.0
  • react-native: 0.61.1 => 0.61.1
@react-native-bot
Copy link
Collaborator

It looks like you are using an older version of React Native. Please update to the latest release, v0.61 and verify if the issue still exists.

The "Resolution: Old Version" label will be removed automatically once you edit your original post with the results of running `react-native info` on a project using the latest release.

@stale
Copy link

stale bot commented Dec 29, 2019

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Dec 29, 2019
@stale
Copy link

stale bot commented Jan 5, 2020

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Jan 5, 2020
@facebook facebook locked as resolved and limited conversation to collaborators Jan 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Platform: Android Android applications. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

2 participants