Commit 6017ed750953bdc0bfdfad4c30ee872c8f8f0690
1 parent
8878e4a3
update scroll when panel opens
Showing
3 changed files
with
7 additions
and
2 deletions
Show diff stats
src/components/date-picker/base/time-spinner.vue
src/components/date-picker/panel/panel-mixin.js
@@ -41,6 +41,9 @@ export default { | @@ -41,6 +41,9 @@ export default { | ||
41 | handleConfirm(visible) { | 41 | handleConfirm(visible) { |
42 | this.$emit('on-pick', this.dates, visible); | 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,12 +230,15 @@ | ||
230 | handleFocus () { | 230 | handleFocus () { |
231 | if (this.readonly) return; | 231 | if (this.readonly) return; |
232 | this.visible = true; | 232 | this.visible = true; |
233 | + this.$refs.pickerPanel.onToggleVisibility(true); | ||
233 | }, | 234 | }, |
234 | handleBlur () { | 235 | handleBlur () { |
235 | this.visible = false; | 236 | this.visible = false; |
236 | this.onSelectionModeChange(this.type); | 237 | this.onSelectionModeChange(this.type); |
237 | this.internalValue = this.internalValue.slice(); // trigger panel watchers to reset views | 238 | this.internalValue = this.internalValue.slice(); // trigger panel watchers to reset views |
238 | this.reset(); | 239 | this.reset(); |
240 | + this.$refs.pickerPanel.onToggleVisibility(false); | ||
241 | + | ||
239 | }, | 242 | }, |
240 | reset(){ | 243 | reset(){ |
241 | this.$refs.pickerPanel.reset && this.$refs.pickerPanel.reset(); | 244 | this.$refs.pickerPanel.reset && this.$refs.pickerPanel.reset(); |