rc-pagination
Advanced tools
Comparing version 1.1.4 to 1.1.5
@@ -15,2 +15,4 @@ 'use strict'; | ||
var KEYCODE = require('./KeyCode'); | ||
var Options = (function (_React$Component) { | ||
@@ -79,3 +81,3 @@ _inherits(Options, _React$Component); | ||
'跳至', | ||
React.createElement('input', { type: 'text', defaultValue: props.current, onChange: this._quickGo, onKeyUp: this._quickGo }), | ||
React.createElement('input', { type: 'text', defaultValue: props.current, onKeyDown: this._checkValid, onChange: this._quickGo, onKeyUp: this._quickGo }), | ||
'页' | ||
@@ -98,2 +100,12 @@ ); | ||
}, { | ||
key: '_checkValid', | ||
value: function _checkValid(evt) { | ||
var keyCode = evt.keyCode; | ||
var valid = keyCode >= KEYCODE.ZERO && keyCode <= KEYCODE.NINE || keyCode >= KEYCODE.NUMPAD_ZERO && keyCode <= KEYCODE.NUMPAD_NINE || keyCode === KEYCODE.DELETE || keyCode === KEYCODE.BACKSPACE || keyCode === KEYCODE.ENTER; | ||
if (!valid) { | ||
evt.preventDefault(); | ||
} | ||
} | ||
}, { | ||
key: '_quickGo', | ||
@@ -100,0 +112,0 @@ value: function _quickGo(evt) { |
@@ -173,3 +173,5 @@ 'use strict'; | ||
selectPrefixCls: props.selectPrefixCls, | ||
changeSize: this.props.showSizeChanger ? this._changePageSize.bind(this) : null, current: this.state.current, quickGo: this.props.showQuickJumper ? this._handleChange.bind(this) : null }) | ||
changeSize: this.props.showSizeChanger ? this._changePageSize.bind(this) : null, | ||
current: this.state.current, | ||
quickGo: this.props.showQuickJumper ? this._handleChange.bind(this) : null }) | ||
); | ||
@@ -188,3 +190,3 @@ } | ||
value: function _isValid(page) { | ||
return typeof page === 'number'; // && page >= 1 && page <= this._calcPage(); | ||
return typeof page === 'number' && page >= 1 && page <= this._calcPage() && page !== this.state.current; | ||
} | ||
@@ -191,0 +193,0 @@ }, { |
{ | ||
"name": "rc-pagination", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"description": "pagination ui component for react", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25459
9
588