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);