Skip to content

KeyboardAvoidingView with behavior="height" doesn't resize back on keyboard close #13754

@ahmed-wagdi

Description

@ahmed-wagdi

Description

When using the KeyboardAvoidingView with behavior set to height it works correctly the first time you open the keyboard, but after keyboard is dismissed it doesn't return to it's original position.

tnyozqi5fe

Recreation:
https://snack.expo.io/rJYAymwy-

The code below can be used to recreate this problem:

<View style={{flex: 1, backgroundColor: "blue"}}>
	<KeyboardAvoidingView behavior="height"  style={{ backgroundColor: "green", paddingTop: 22, flex: 1, justifyContent: 'center'}}>
	    <View>
	          <TextInput style={{height: 30, backgroundColor: "red"}} />
	    </View>
	</KeyboardAvoidingView>
</View>

Additional Information

  • React Native version: 0.43.4
  • Development Operating System: MacOS
  • Dev tools: This was shown on the IOS simulator but the problem also occurs on android

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions