mirror of
https://github.com/hodgef/simple-keyboard.git
synced 2026-06-25 00:00:20 +08:00
Setting newLineOnEnter false by default
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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}',
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user