wix-incubator / react-native-keyboard-input

Use your own custom input component instead of the system keyboard
MIT License
819 stars 150 forks source link

Custom keyboard view not working iOS #75

Closed jeffreyyu0602 closed 5 years ago

jeffreyyu0602 commented 5 years ago

I am not sure what I am doing wrong but when I update the kbcomponent nothing changed. I cannot render my custom keyboard view. I followed the installation guide, dragging KeyboardTrackingView and RCTCustomInputController to the Library. I have everything in the demo: registering the keyboard, updating the state, passing it to the KeyboardAccessoryView. Can someone help me? The following is my code:

Custom Keyboard:

import React, { Component } from 'react';
import { FlatList } from 'react-native';
import { KeyboardRegistry } from 'react-native-keyboard-input';

class ImageSelector extends Component {
  render() {
    console.log("Rendered");
    return (
      <FlatList
        style={styles.flatListStyle}
      />
    );
  }
}

const styles = {
  flatListStyle: {
    height: 300,
    backgroundColor: 'purple'
  }
};

KeyboardRegistry.registerKeyboard('ImageSelector', () => ImageSelector);

Using the keyboard:

<KeyboardAccessoryView
  renderContent={this.keyboardAccessoryViewContent}
  onHeightChanged={this.props.onFocus}
  trackInteractive={true}
  kbInputRef={this.textInputRef}
  kbComponent={this.state.customKeyboard.component}
  kbInitialProps={this.state.customKeyboard.initialProps}
  onItemSelected={this.onKeyboardItemSelected}
  onKeyboardResigned={this.onKeyboardResigned}
  revealKeyboardInteractive
/>
hinterlist commented 5 years ago

You've closed this ticket, have you managed to fix it? If so, could you please share what was an issue? Thanks.