Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlevy0 authored Feb 17, 2020
1 parent 3f752ac commit 11c8b4e
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,25 @@ export class CustomTextInput extends Component {
...TextInput.propTypes,
customKeyboardType: PropTypes.string,
};

this.input = () => null;

installKeyboard({ maxLength, customKeyboardType }) {
if (!this.input) {
console.warn('installKeyboard fired without input ref');
return;
}
install(
findNodeHandle(this.input || null),
customKeyboardType,
maxLength === undefined ? 1024 : maxLength,
getKeyboardHeightByType(customKeyboardType)
);
try {
const node = findNodeHandle(this.input || null);
install(
node,
customKeyboardType,
maxLength === undefined ? 1024 : maxLength,
getKeyboardHeightByType(customKeyboardType)
);
} catch {
console.warn('installKeyboard fired without input ref');
return;
}
}

componentDidMount() {
Expand Down

0 comments on commit 11c8b4e

Please # to comment.