Skip to content

Commit

Permalink
fix js error when clicking more link
Browse files Browse the repository at this point in the history
  • Loading branch information
arshaw committed Dec 28, 2018
1 parent ff94cb2 commit d874e65
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/interactions/EventClicking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@ export default class EventClicking {

handleSegClick = (ev: Event, segEl: HTMLElement) => {
let { component } = this
let seg = getElSeg(segEl)!
let seg = getElSeg(segEl)

if (component.isValidSegDownEl(ev.target as HTMLElement)) {
if (
seg && // might be the <div> surrounding the more link
component.isValidSegDownEl(ev.target as HTMLElement)
) {

// our way to simulate a link click for elements that can't be <a> tags
// grab before trigger fired in case trigger trashes DOM thru rerendering
Expand Down
36 changes: 36 additions & 0 deletions tests/automated/legacy/eventLimit-popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,42 @@ describe('eventLimit popover', function() {
expect(el).not.toHaveClass('fc-not-end')
})
})

// https://github.com/fullcalendar/fullcalendar/issues/4331
it('displays events that were collapsed in previous days', function() {
initCalendar({
defaultDate: '2018-10-01',
events: [
{
title: 'e1',
start: '2018-10-18'
},
{
title: 'e2',
start: '2018-10-18',
},
{
title: 'e3',
start: '2018-10-18T11:00:00',
},
{
title: 'e4',
start: '2018-10-18T12:00:00',
end: '2018-10-19T12:00:00'
},
{
title: 'e5',
start: '2018-10-19',
className: 'event-e5',
}
]
})

// click the second +more link
$('.event-e5').closest('.fc-event-container').find('.fc-more')
.simulate('click')
})

})

describeOptions('defaultView', {
Expand Down

0 comments on commit d874e65

Please sign in to comment.