pagination icon indicating copy to clipboard operation
pagination copied to clipboard

当跳转页输入框失去焦点后会重置到首页

Open Cyonet opened this issue 7 years ago • 0 comments

由于commit203修改造成跳转输入框失去焦点被重置到第一页 在Options中有对空字符串转化为0操作

  getValidValue() {
    const { goInputText, current } = this.state;
    return isNaN(goInputText) ? current : Number(goInputText);
  }

 handleBlur = () => {
    const { goButton, quickGo } = this.props;
    if (goButton) {
      return;
    }
    quickGo(this.getValidValue());
  }

  go = (e) => {
    const { goInputText } = this.state;
    if (goInputText === '') {
      return;
    }
    if (e.keyCode === KEYCODE.ENTER || e.type === 'click') {
      this.setState({
        goInputText: '',
      });
      this.props.quickGo(this.getValidValue());
    }
 }

Cyonet avatar Sep 30 '19 10:09 Cyonet