From d907505b9f219f4ef2885166846251c7e0c65de9 Mon Sep 17 00:00:00 2001
From: Aleksandr Denisenko <aleksandr.denisenko.it@gmail.com>
Date: Fri, 17 Nov 2017 11:55:18 +0200
Subject: make header input readonly by an optional prop

---
 src/TimePicker.jsx | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

(limited to 'src/TimePicker.jsx')

diff --git a/src/TimePicker.jsx b/src/TimePicker.jsx
index 9a91a2c..039c2f5 100644
--- a/src/TimePicker.jsx
+++ b/src/TimePicker.jsx
@@ -18,6 +18,7 @@ export default class Picker extends Component {
     clearText: PropTypes.string,
     value: PropTypes.object,
     defaultOpenValue: PropTypes.object,
+    readOnlyInput: PropTypes.bool,
     disabled: PropTypes.bool,
     allowEmpty: PropTypes.bool,
     defaultValue: PropTypes.object,
@@ -60,6 +61,7 @@ export default class Picker extends Component {
     clearText: 'clear',
     prefixCls: 'rc-time-picker',
     defaultOpen: false,
+    readOnlyInput: false,
     style: {},
     className: '',
     popupClassName: '',
@@ -167,7 +169,7 @@ export default class Picker extends Component {
   getPanelElement() {
     const {
       prefixCls, placeholder, disabledHours,
-      disabledMinutes, disabledSeconds, hideDisabledOptions,
+      disabledMinutes, disabledSeconds, hideDisabledOptions, readOnlyInput,
       allowEmpty, showHour, showMinute, showSecond, defaultOpenValue, clearText,
       addon, use12Hours, focusOnOpen, onKeyDown, hourStep, minuteStep, secondStep,
     } = this.props;
@@ -177,6 +179,7 @@ export default class Picker extends Component {
         prefixCls={`${prefixCls}-panel`}
         ref={this.savePanelRef}
         value={this.state.value}
+        readOnlyInput={readOnlyInput}
         onChange={this.onPanelChange}
         onClear={this.onPanelClear}
         defaultOpenValue={defaultOpenValue}
-- 
cgit v1.2.3

