update scroll when panel opens

This commit is contained in:
Sergio Crisostomo 2018-02-05 07:50:23 +01:00
parent 8878e4a351
commit 6017ed7509
3 changed files with 7 additions and 2 deletions

View file

@ -194,7 +194,6 @@
} }
}, },
mounted () { mounted () {
this.updateScroll();
this.$nextTick(() => this.compiled = true); this.$nextTick(() => this.compiled = true);
} }
}; };

View file

@ -41,6 +41,9 @@ export default {
handleConfirm(visible) { handleConfirm(visible) {
this.$emit('on-pick', this.dates, visible); this.$emit('on-pick', this.dates, visible);
}, },
onToggleVisibility(open){
const timeSpinner = this.$refs.timeSpinner;
if (open && timeSpinner) timeSpinner.updateScroll();
}
} }
}; };

View file

@ -230,12 +230,15 @@
handleFocus () { handleFocus () {
if (this.readonly) return; if (this.readonly) return;
this.visible = true; this.visible = true;
this.$refs.pickerPanel.onToggleVisibility(true);
}, },
handleBlur () { handleBlur () {
this.visible = false; this.visible = false;
this.onSelectionModeChange(this.type); this.onSelectionModeChange(this.type);
this.internalValue = this.internalValue.slice(); // trigger panel watchers to reset views this.internalValue = this.internalValue.slice(); // trigger panel watchers to reset views
this.reset(); this.reset();
this.$refs.pickerPanel.onToggleVisibility(false);
}, },
reset(){ reset(){
this.$refs.pickerPanel.reset && this.$refs.pickerPanel.reset(); this.$refs.pickerPanel.reset && this.$refs.pickerPanel.reset();