Commit 6017ed750953bdc0bfdfad4c30ee872c8f8f0690

Authored by Sergio Crisostomo
1 parent 8878e4a3

update scroll when panel opens

src/components/date-picker/base/time-spinner.vue
... ... @@ -194,7 +194,6 @@
194 194 }
195 195 },
196 196 mounted () {
197   - this.updateScroll();
198 197 this.$nextTick(() => this.compiled = true);
199 198 }
200 199 };
... ...
src/components/date-picker/panel/panel-mixin.js
... ... @@ -41,6 +41,9 @@ export default {
41 41 handleConfirm(visible) {
42 42 this.$emit('on-pick', this.dates, visible);
43 43 },
44   -
  44 + onToggleVisibility(open){
  45 + const timeSpinner = this.$refs.timeSpinner;
  46 + if (open && timeSpinner) timeSpinner.updateScroll();
  47 + }
45 48 }
46 49 };
... ...
src/components/date-picker/picker.vue
... ... @@ -230,12 +230,15 @@
230 230 handleFocus () {
231 231 if (this.readonly) return;
232 232 this.visible = true;
  233 + this.$refs.pickerPanel.onToggleVisibility(true);
233 234 },
234 235 handleBlur () {
235 236 this.visible = false;
236 237 this.onSelectionModeChange(this.type);
237 238 this.internalValue = this.internalValue.slice(); // trigger panel watchers to reset views
238 239 this.reset();
  240 + this.$refs.pickerPanel.onToggleVisibility(false);
  241 +
239 242 },
240 243 reset(){
241 244 this.$refs.pickerPanel.reset && this.$refs.pickerPanel.reset();
... ...