aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/module/Header.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/module/Header.jsx')
-rw-r--r--src/module/Header.jsx18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/module/Header.jsx b/src/module/Header.jsx
index 33dec43..41099cc 100644
--- a/src/module/Header.jsx
+++ b/src/module/Header.jsx
@@ -1,4 +1,4 @@
1import React, {PropTypes} from 'react'; 1import React, { PropTypes } from 'react';
2import createSelection from '../util/selection'; 2import createSelection from '../util/selection';
3 3
4const Header = React.createClass({ 4const Header = React.createClass({
@@ -57,7 +57,7 @@ const Header = React.createClass({
57 str, 57 str,
58 }); 58 });
59 let value = null; 59 let value = null;
60 const {formatter, gregorianCalendarLocale, hourOptions, minuteOptions, secondOptions, disabledHours, disabledMinutes, disabledSeconds, onChange, allowEmpty} = this.props; 60 const { formatter, gregorianCalendarLocale, hourOptions, minuteOptions, secondOptions, disabledHours, disabledMinutes, disabledSeconds, onChange, allowEmpty } = this.props;
61 61
62 if (str) { 62 if (str) {
63 const originalValue = this.props.value; 63 const originalValue = this.props.value;
@@ -144,7 +144,7 @@ const Header = React.createClass({
144 }, 144 },
145 145
146 onClear() { 146 onClear() {
147 this.setState({str: ''}); 147 this.setState({ str: '' });
148 this.props.onClear(); 148 this.props.onClear();
149 }, 149 },
150 150
@@ -160,11 +160,13 @@ const Header = React.createClass({
160 const { prefixCls, placeholder } = this.props; 160 const { prefixCls, placeholder } = this.props;
161 const { invalid, str } = this.state; 161 const { invalid, str } = this.state;
162 const invalidClass = invalid ? `${prefixCls}-input-invalid` : ''; 162 const invalidClass = invalid ? `${prefixCls}-input-invalid` : '';
163 return (<input className={`${prefixCls}-input ${invalidClass}`} 163 return (<input
164 ref="input" 164 className={`${prefixCls}-input ${invalidClass}`}
165 onKeyDown={this.onKeyDown} 165 ref="input"
166 value={str} 166 onKeyDown={this.onKeyDown}
167 placeholder={placeholder} onChange={this.onInputChange}/>); 167 value={str}
168 placeholder={placeholder} onChange={this.onInputChange}
169 />);
168 }, 170 },
169 171
170 selectRange() { 172 selectRange() {