Andr3wHur5t / react-native-keyboard-spacer

Plug and play react-native keyboard spacer view.
MIT License
1.56k stars 219 forks source link

Keyboard Immediately Dismissed on Native Starter Kit #29

Closed geirman closed 7 years ago

geirman commented 8 years ago

I'm using the native-starter-kit as a basis, trying to customize it. On their login/index.js page, I've tried adding <KeyboardSpacer /> between lines 60-61 and between lines 62-63, but in either case the keyboard starts to show and is immediately dismissed.

            <Container theme={theme}>
                <View style={styles.container}>
                    <Content>
                        <Image source={require('../../../images/shadow.png')} style={styles.shadow}>
                            <View style={styles.bg}>
                                <InputGroup style={{marginBottom: 20}}>
                                    <Icon name="ios-person" />
                                    <Input placeholder="EMAIL" />
                                </InputGroup>
                                <InputGroup style={{marginBottom: 10}}>
                                    <Icon name="ios-unlock-outline" />
                                    <Input
                                        placeholder="PASSWORD"
                                        secureTextEntry={true}
                                    />
                                </InputGroup>
                                <Button style={{marginTop: 20, alignSelf: 'center'}} textStyle={{color: '#fff'}} onPress={() => this.replaceRoute('home')}>
                                    Login
                                </Button>
                            </View>
                        </Image>
                        <KeyboardSpacer />
                    </Content>
                </View>
            </Container>

geirman commented 8 years ago

Incidentally, I also tried between lines 64-65 and 65-66 as well with no luck.

Andr3wHur5t commented 8 years ago

The spacer view won't modify any other view than itself, currently it just listens to keyboard events and modifies its size to occupied the space the virtual keyboard is occupying.

Only think i can think of given your example is moving keyboard spacer at the root most of the applications view hierarchy.

Other than that I would check your inputs are automatically coming out of focus.

Andr3wHur5t commented 7 years ago

Closing for inactivity.

geirman commented 7 years ago

Shouldn't this be fixed rather than ignored?

Andr3wHur5t commented 7 years ago

@geirman if you can provide more information I would be happy to help.

As I stated with my replay 8 months ago this module only listens to events and resizes self.

By design it does not change focus of elements or other actions that would dismiss a keyboard from the screen.

I closed this issue because I thought my explanation was clear and I did not see a response from anyone for 8 months making me think this was resolved.

If you feel this is not resolved please reopen the issue and provided more details.