Skip to content

Commit c87ce56

Browse files
committed
fix(CCalendar, CDatePicker, CDateRangePick
er): calendar panels are removed when you click the year or month
1 parent a03cf57 commit c87ce56

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

js/src/calendar.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,15 +201,13 @@ class Calendar extends BaseComponent {
201201
EventHandler.on(this._element, 'click', '.btn-month', event => {
202202
event.preventDefault()
203203
this._view = 'months'
204-
this._element.innerHTML = ''
205-
this._createCalendarPanel()
204+
this._updateCalendar()
206205
})
207206

208207
EventHandler.on(this._element, 'click', '.btn-year', event => {
209208
event.preventDefault()
210209
this._view = 'years'
211-
this._element.innerHTML = ''
212-
this._createCalendarPanel()
210+
this._updateCalendar()
213211
})
214212
}
215213

@@ -403,7 +401,7 @@ class Calendar extends BaseComponent {
403401

404402
_updateCalendar() {
405403
this._element.innerHTML = ''
406-
this._createCalendarPanel()
404+
this._createCalendar()
407405
}
408406

409407
_dayClassNames(date, month) {

0 commit comments

Comments
 (0)