Skip to content

Commit

Permalink
fix(VCalendar): missing events under certain circumstances (#13763)
Browse files Browse the repository at this point in the history
fixes #13720
  • Loading branch information
jacekkarczmarczyk committed Jun 14, 2021
1 parent 5fbea51 commit 8226cc9
Showing 1 changed file with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,23 +172,25 @@ export default CalendarBase.extend({

const parentBounds = parent.getBoundingClientRect()
const last = events.length - 1
let hide = false
const eventsSorted = events.map(event => ({
event,
bottom: event.getBoundingClientRect().bottom,
})).sort((a, b) => a.bottom - b.bottom)
let hidden = 0

for (let i = 0; i <= last; i++) {
if (!hide) {
const eventBounds = events[i].getBoundingClientRect()
hide = i === last
? (eventBounds.bottom > parentBounds.bottom)
: (eventBounds.bottom + eventHeight > parentBounds.bottom)
}
const bottom = eventsSorted[i].bottom
const hide = i === last
? (bottom > parentBounds.bottom)
: (bottom + eventHeight > parentBounds.bottom)

if (hide) {
events[i].style.display = 'none'
eventsSorted[i].event.style.display = 'none'
hidden++
}
}

if (hide) {
if (hidden) {
more.style.display = ''
more.innerHTML = this.$vuetify.lang.t(this.eventMoreText, hidden)
} else {
Expand Down

0 comments on commit 8226cc9

Please sign in to comment.