]> git.immae.eu Git - github/fretlink/time-picker.git/commitdiff
Merge pull request #60 from shoaibbhimani/master
author偏右 <afc163@gmail.com>
Sun, 22 Oct 2017 08:21:13 +0000 (16:21 +0800)
committerGitHub <noreply@github.com>
Sun, 22 Oct 2017 08:21:13 +0000 (16:21 +0800)
Add keydown function on header input

1  2 
src/TimePicker.jsx

diff --combined src/TimePicker.jsx
index 6e164579bb6242452c750c14254d69565abeae9f,0b985dd41b052498bc0e0a69fa436c65d02dcc29..271515da4af3973ac5ed0486c3bbc1f1e8948a6d
@@@ -42,12 -42,11 +42,13 @@@ export default class Picker extends Com
      onChange: PropTypes.func,
      onOpen: PropTypes.func,
      onClose: PropTypes.func,
 +    onFocus: PropTypes.func,
 +    onBlur: PropTypes.func,
      addon: PropTypes.func,
      name: PropTypes.string,
      autoComplete: PropTypes.string,
      use12Hours: PropTypes.bool,
+     onKeyDown: PropTypes.func,
    };
  
    static defaultProps = {
      onChange: noop,
      onOpen: noop,
      onClose: noop,
 +    onFocus: noop,
 +    onBlur: noop,
      addon: noop,
      use12Hours: false,
+     onKeyDown: noop,
    };
  
    constructor(props) {
        prefixCls, placeholder, disabledHours,
        disabledMinutes, disabledSeconds, hideDisabledOptions,
        allowEmpty, showHour, showMinute, showSecond, defaultOpenValue, clearText,
-       addon, use12Hours,
+       addon, use12Hours, onKeyDown,
      } = this.props;
      return (
        <Panel
          hideDisabledOptions={hideDisabledOptions}
          use12Hours={use12Hours}
          addon={addon}
+         onKeyDown={onKeyDown}
        />
      );
    }
      const {
        prefixCls, placeholder, placement, align,
        disabled, transitionName, style, className, getPopupContainer, name, autoComplete,
 +      onFocus, onBlur,
      } = this.props;
      const { open, value } = this.state;
      const popupClassName = this.getPopupClassName();
              onKeyDown={this.onKeyDown}
              disabled={disabled} value={value && value.format(this.getFormat()) || ''}
              autoComplete={autoComplete}
 +            onFocus={onFocus}
 +            onBlur={onBlur}
            />
            <span className={`${prefixCls}-icon`}/>
          </span>