]> git.immae.eu Git - github/fretlink/time-picker.git/blobdiff - src/module/Panel.jsx
select input value range when enter different select panel
[github/fretlink/time-picker.git] / src / module / Panel.jsx
index 2c2f5544333c606631cb723e9b9596f3a1954fa7..63823ee07e0a37d53662a772f754bbe58175b634 100644 (file)
@@ -48,6 +48,7 @@ const Panel = React.createClass({
   getInitialState() {
     return {
       value: this.props.value,
+      selectionRange: [],
     };
   },
 
@@ -69,6 +70,10 @@ const Panel = React.createClass({
     this.props.onClear();
   },
 
+  onCurrentSelectPanelChange(currentSelectPanel) {
+    this.setState({ currentSelectPanel });
+  },
+
   render() {
     const { locale, prefixCls, placeholder, hourOptions, minuteOptions, secondOptions, allowEmpty, showHour, showSecond, formatter, gregorianCalendarLocale } = this.props;
     const value = this.state.value;
@@ -79,6 +84,7 @@ const Panel = React.createClass({
           gregorianCalendarLocale={gregorianCalendarLocale}
           locale={locale}
           value={value}
+          currentSelectPanel={this.state.currentSelectPanel}
           onEsc={this.props.onEsc}
           formatter={formatter}
           placeholder={placeholder}
@@ -100,6 +106,7 @@ const Panel = React.createClass({
           hourOptions={hourOptions}
           minuteOptions={minuteOptions}
           secondOptions={secondOptions}
+          onCurrentSelectPanelChange={this.onCurrentSelectPanelChange}
         />
       </div>
     );