react-numboard
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -73,3 +73,3 @@ import React, { Component } from 'react'; | ||
this.state = { | ||
value: '1', | ||
value: 0, | ||
disabled: false, | ||
@@ -92,3 +92,3 @@ }; | ||
<NumInput | ||
onChange={(value) => { this.setState({value}); console.log('change');}} | ||
onChange={(val) => { this.setState({ value: val }); console.log('change'); }} | ||
value={value} | ||
@@ -100,3 +100,3 @@ disabled={disabled} | ||
<Col span={12}> | ||
<Button onClick={() => { this.setState({ value: '+1s', disabled: !disabled }); }}> disabled </Button> | ||
<Button onClick={() => { this.setState({ value: '+1s', disabled: !disabled }); }}> disabled </Button> | ||
</Col> | ||
@@ -103,0 +103,0 @@ </Row> |
@@ -145,7 +145,12 @@ 'use strict'; | ||
_this.onDeleteNum = function () { | ||
var _this$state$value2 = _this.state.value, | ||
value = _this$state$value2 === undefined ? '' : _this$state$value2; | ||
var value = _this.state.value; | ||
if (value.length > 0) { | ||
var newValue = value.slice(0, value.length - 1); | ||
if (value == null) { | ||
return; | ||
} | ||
var val = value.toString(); | ||
if (val.length > 0) { | ||
var newValue = val.slice(0, val.length - 1); | ||
_this.setState({ value: newValue }); | ||
@@ -152,0 +157,0 @@ _this.triggerChange(newValue); |
{ | ||
"name": "react-numboard", | ||
"version": "1.0.3", | ||
"description": "", | ||
"version": "1.0.4", | ||
"description": "react number keyboard", | ||
"main": "./lib/index.js", | ||
@@ -45,4 +45,10 @@ "dependencies": { | ||
}, | ||
"author": "", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/gewenmao/react-numboard.git" | ||
}, | ||
"author": [ | ||
"gewenmao" | ||
], | ||
"license": "MIT" | ||
} |
@@ -131,5 +131,11 @@ import React, { Component } from 'react'; | ||
onDeleteNum = () => { | ||
const { value = '' } = this.state; | ||
if (value.length > 0) { | ||
const newValue = value.slice(0, value.length - 1); | ||
const { value } = this.state; | ||
if (value == null) { | ||
return; | ||
} | ||
const val = value.toString(); | ||
if (val.length > 0) { | ||
const newValue = val.slice(0, val.length - 1); | ||
this.setState({ value: newValue }); | ||
@@ -136,0 +142,0 @@ this.triggerChange(newValue); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
4042978
23
36825
1
18
0
0