Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions lib/KeyboardAwareHOC.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,13 @@ function listenToKeyboardEvents(ScrollableComponent: React$Component) {

// Keyboard actions
_updateKeyboardSpace = (frames: Object) => {
let keyboardSpace: number =
frames.endCoordinates.height + this.props.extraScrollHeight
if (this.props.viewIsInsideTabBar) {
keyboardSpace -= _KAM_DEFAULT_TAB_BAR_HEIGHT
}
this.setState({ keyboardSpace })
// Automatically scroll to focused TextInput
if (this.props.enableAutoAutomaticScroll) {
Copy link
Collaborator

@alvaromb alvaromb Jan 19, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey! Can you rename this prop to the intended name? It should be enableAutomaticScroll, not enableAutoAutomaticScroll (note the extra Auto). This has been an error I've introduced myself, but it would be great to change it with this PR.

let keyboardSpace: number = frames.endCoordinates.height + this.props.extraScrollHeight
if (this.props.viewIsInsideTabBar) {
keyboardSpace -= _KAM_DEFAULT_TAB_BAR_HEIGHT
}
this.setState({ keyboardSpace })
const currentlyFocusedField = TextInput.State.currentlyFocusedField()
const responder = this.getScrollResponder()
if (!currentlyFocusedField || !responder) {
Expand Down