]> git.immae.eu Git - github/fretlink/time-picker.git/commitdiff
Fix disabled style, close #58
authorafc163 <afc163@gmail.com>
Sun, 22 Oct 2017 08:53:12 +0000 (16:53 +0800)
committerafc163 <afc163@gmail.com>
Sun, 22 Oct 2017 08:53:12 +0000 (16:53 +0800)
assets/index/Picker.less
examples/disabled.js

index 1fb3787a03d2359c0a344c2b752bef4855200a01..610c2b0a45bc9231ac4c8d6eecf971579a7e6131 100644 (file)
     border: 1px solid #d9d9d9;
     border-radius: 4px;
     transition: border .2s cubic-bezier(0.645, 0.045, 0.355, 1), background .2s cubic-bezier(0.645, 0.045, 0.355, 1), box-shadow .2s cubic-bezier(0.645, 0.045, 0.355, 1);
+    &[disabled] {
+      color: #ccc;
+      background: #f7f7f7;
+      cursor: not-allowed;
+    }
   }
 }
index 9d740021aab0bd56bc888a4ed485934f965133df..a38ce160611df57c35098b357dfcac13443ea7c8 100644 (file)
@@ -48,14 +48,22 @@ function disabledSeconds(h, m) {
 }
 
 ReactDom.render(
-  <TimePicker
-    showSecond={showSecond}
-    defaultValue={now}
-    className="xxx"
-    onChange={onChange}
-    disabledHours={disabledHours}
-    disabledMinutes={disabledMinutes}
-    disabledSeconds={disabledSeconds}
-  />,
-  document.getElementById('__react-content')
-);
+  <div>
+    <h3>Disabled picker</h3>
+    <TimePicker
+      defaultValue={now}
+      disabled
+      onChange={onChange}
+    />
+    <h3>Disabled options</h3>
+    <TimePicker
+      showSecond={showSecond}
+      defaultValue={now}
+      className="xxx"
+      onChange={onChange}
+      disabledHours={disabledHours}
+      disabledMinutes={disabledMinutes}
+      disabledSeconds={disabledSeconds}
+    />
+  </div>
+, document.getElementById('__react-content'));