FIX: safari desktop doesnt support input[time] (#7719)

This commit attempts to improve the experience by:
- showing time input as disabled on any platform if date hasn't been set
- showing a placeholder --:-- to emphasize the expected format
This commit is contained in:
Joffrey JAFFEUX 2019-06-07 07:50:43 +02:00 committed by Sam
parent 8bd815dab2
commit a652d620f6
3 changed files with 7 additions and 1 deletions

View File

@ -36,6 +36,8 @@ export default Ember.Component.extend({
} }
}, },
timeInputDisabled: Ember.computed.empty("date"),
@observes("date", "time") @observes("date", "time")
_updateInput() { _updateInput() {
if (!this.date) { if (!this.date) {

View File

@ -21,7 +21,7 @@
<div class="control-group"> <div class="control-group">
{{d-icon "far-clock"}} {{d-icon "far-clock"}}
{{input type="time" value=time}} {{input placeholder="--:--" type="time" value=time disabled=timeInputDisabled}}
</div> </div>
{{/if}} {{/if}}

View File

@ -49,6 +49,10 @@
font-size: $font-up-1; font-size: $font-up-1;
} }
} }
input[disabled] {
background: $primary-low;
}
} }
.pika-single { .pika-single {
position: absolute !important; /* inline JS styles */ position: absolute !important; /* inline JS styles */