From 988b8a0f647ba34d044589c646f04b3e6ebabab7 Mon Sep 17 00:00:00 2001 From: Francisco Hodge Date: Thu, 12 Apr 2018 12:25:10 -0400 Subject: [PATCH] Setting newLineOnEnter false by default --- README.md | 4 ++-- src/demo/App.js | 1 + src/lib/components/Keyboard.js | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e056b7d1..94abb22b 100644 --- a/README.md +++ b/README.md @@ -126,10 +126,10 @@ debug={false} > Specifies whether clicking the "ENTER" button will input a newline (`\n`) or not. ```js -newLineOnEnter={true} +newLineOnEnter={false} ``` -## Methods +## MethodsS simple-keybord has a few methods you can use to further control it's behavior. To access these functions, you need a `ref` of the simple-keyboard component, like so: diff --git a/src/demo/App.js b/src/demo/App.js index ff9be150..f460227f 100644 --- a/src/demo/App.js +++ b/src/demo/App.js @@ -54,6 +54,7 @@ class App extends Component { onChange={input => this.onChange(input)} onKeyPress={button => this.onKeyPress(button)} layoutName={this.state.layoutName} + newLineOnEnter={true} layout={{ 'default': [ '` 1 2 3 4 5 6 7 8 9 0 - = {bksp}', diff --git a/src/lib/components/Keyboard.js b/src/lib/components/Keyboard.js index b4a8942a..e3d580e1 100644 --- a/src/lib/components/Keyboard.js +++ b/src/lib/components/Keyboard.js @@ -65,7 +65,7 @@ class App extends Component { * Updating input */ let options = { - newLineOnEnter: this.props.newLineOnEnter !== false || true + newLineOnEnter: (this.props.newLineOnEnter === true) } let updatedInput = Utilities.getUpdatedInput(button, this.state.input, options);