question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ListView + TextInput = troubles with soft keyboard

See original GitHub issue

I’am trying to avoid keyboard autohides, when text field is placed at the bottom of the screen, so I need to reduce the main View height to lift up this text field. The events are described below doesn’t work at all, all variants I used don’t show results, is it my mistake or a bug in RN?

import { Dimensions } from 'react-native';
const { Keyboard } = require('react-native');

class Form extends Component {

  constructor (props) {
    super(props);
    this.state = {
      visibleHeight: Dimensions.get('window').height
    };
  }

  componentWillMount () {
    Keyboard.addListener('keyboardWillShow', this.keyboardWillShow.bind(this));
    Keyboard.addListener('keyboardWillHide', this.keyboardWillHide.bind(this));
  }

  keyboardWillShow (e) {
    console.log('keyboardWillShow');
  }

  keyboardWillHide (e) {
    console.log('keyboardWillHide');
  }
  render(route, navigator) {
    return (
      <View style={[styles.main_container, {height: this.state.visibleHeight}]}></View>
    )
}

anim

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:5
  • Comments:15 (4 by maintainers)

github_iconTop GitHub Comments

9reactions
latusakicommented, Sep 26, 2016

@af7 for me wherever I have text that is obstructed by keyboard, the whole view is scrolled up smoothly. I had to add the following on AndroidManifest, as it would get stuck sometimes after putting the app on background:

android:windowSoftInputMode="adjustPan"

5reactions
KishPatel1996commented, Aug 3, 2016

Is there a way to use KeyboardAvoidingView with a ScrollView?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issue with EditText in Listview softkeyboard - Stack Overflow
1 Answer 1 ... First write down android:windowSoftInputMode="adjustPan" in Activity in Manifest file to set listview and Edittext and delete ...
Read more >
How to open or dismiss the keyboard in Flutter - LogRocket Blog
Using Flutter, learn how to open and close the keyboard on mobile apps, and move across different widgets without dismissing the keyboard.
Read more >
Mobile Keyboard - Unity - Manual
In most cases, Unity will handle keyboard input automatically for GUI ... The keyboard will appear automatically when a user taps on editable...
Read more >
Toggle State in Listview with Keyboard Input in UI for WinForms ...
Hello, I'm having an issue incorporating a RadToggleSwitchElement into a SimpleListViewVisualItem I'm using in a RadListView. I incorporated it a while...
Read more >
ListView - Android Developers
Check whether the called view is a text editor, in which case it would make sense to automatically display a soft input window...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found