question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't click on some dates. Fullcalendar not working because of overflow-x and height on html element

See original GitHub issue

I am using the npm version of fullcalendar and I tried to recreate this in the JS Bin but I can’t reproduce it there. I copied the settings from JS Bin but it just doesn’t work on my build. (Read more on when it only works)

Here’s what I’m trying in my build: http://output.jsbin.com/boxuqenupi/

I expect that clicking on all of the date to do console.log() but on mine, it doesn’t log. Not only the select does not get fired but it doesn’t even highlight the date at all.

I thought at first there was some conflict on other packages so I reduced my code to very basic as possible but still used the options from JS Bin:

import $ from 'jquery'
import 'fullcalendar/dist/fullcalendar.min.css'
import 'fullcalendar/dist/fullcalendar.min.js'

$('#calendar').fullCalendar({
    header: {
      left: 'prev,next today',
      center: 'title',
      right: 'month,agendaWeek,agendaDay,listWeek'
    },
    selectable: true,
    select: function () {
       console.log('clicked')
    },
    defaultDate: '2017-03-31',
    editable: true,
    eventLimit: true, // allow "more" link when too many events
    events: [
      {
        title: 'All Day Event',
        start: '2017-03-01'
      },
      {
        title: 'Long Event',
        start: '2017-03-07',
        end: '2017-03-10'
      },
      {
        id: 999,
        title: 'Repeating Event',
        start: '2017-03-09T16:00:00'
      },
      {
        id: 999,
        title: 'Repeating Event',
        start: '2017-03-16T16:00:00'
      },
      {
        title: 'Conference',
        start: '2017-03-30',
        end: '2017-04-01'
      },
      {
        title: 'Meeting',
        start: '2017-03-31T10:30:00',
        end: '2017-03-31T12:30:00'
      },
      {
        title: 'Lunch',
        start: '2017-03-31T12:00:00'
      },
      {
        title: 'Meeting',
        start: '2017-03-31T14:30:00'
      },
      {
        title: 'Happy Hour',
        start: '2017-03-31T17:30:00'
      },
      {
        title: 'Dinner',
        start: '2017-03-31T20:00:00'
      },
      {
        title: 'Birthday Party',
        start: '2017-04-01T07:00:00'
      },
      {
        title: 'Click for Google',
        url: 'http://google.com/',
        start: '2017-03-28'
      }
    ]
  });

The very same options I used in the JS Bin i provided.

It works IF there’s only the calendar and that script on the page. There’s no other script on the page that can cause conflict aside from fullcalendar itself and jquery.

It also works if I opened Chrome Dev Tools and put it in the right side and scaled it up so that the calendar get squished and it’s height fit the screen. When the height fits the screen it now works.

But if it’s only the calendar and the script, it works too! And doesn’t even need the height to fit the screen.

My page has a very simple layout: Fixed topbar, Fixed sidebar, and the content.

EDIT Tried loading libs from CDN and initializing from the page directly. Still doesn’t work.

EDIT Tried playing with scrollbar. I can select some dates if I played with scrollbar and some others will be unselectable.

EDIT I deleted elements from Chrome Dev Tools one by one. I found out what causes the conflict. The semantic ui css. I don’t exactly know why tho

EDIT Here is a fiddle the reproduced the bug: http://jsbin.com/cukohicebo When it is on fullscreen some dates are not clickable

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:30 (9 by maintainers)

github_iconTop GitHub Comments

22reactions
iameddzcommented, Oct 25, 2017

found a solution: .fc-scroller { overflow-x: visible !Important; }

6reactions
feliperaulcommented, Aug 19, 2017

@arshaw I would highly recomend re-opening this bug. This was was a pain to debug and I can confirm it happens with overflow-x: hidden set on html.

After I had complaints, I couldn’t believe them because I use an external monitor with a lot of height. But after I tried it on my macbook with a smaller screen, only the bottom row of my calendar wasn’t clickable. Opening dev tools made it worse, because then only the first 2 rows of dates could be clicked.

I later found out that all this was happening due to viewport height. Since every time I had Chrome devtools open in a different height, every time a different row stopped working.

After banging my head for a while, I discovered this: https://stackoverflow.com/a/39342912/1290457

So, yes, this is a bug, it is hurting people, very hard to debug, and the only hack so far is to remove overflow-x: hidden from html element.

I’m on fullcalendar v3.4.0 and I don’t have jqueryUI in my project. Using $('body').on('click', function(e) { console.log(e.target) } ) I can see that the click events are firing, so fullcalendar should be reacting to them, but dayclick never fires and the day doesn’t even get highlighted.

Read more comments on GitHub >

github_iconTop Results From Across the Web

FullCalendar dayClick not working (does nothing)
I found that on my calendar the div with the class fc-bg was hidden by using display:none; . It turns out that this...
Read more >
CSS Customization - Docs - FullCalendar
This article describes the various techniques for customizing the CSS of your calendar.
Read more >
https://gisweb10.highpointnc.gov/js/libs/fullcalen...
Significant changes to HTML/CSS skeleton: - Leverages tables for liquid rendering ... event not working on event elements ([936]) - Agenda event dragging, ......
Read more >
Safari Technology Preview Release Notes - Apple Developer
Fixed a bug where clicking anywhere on the progress bar pauses some MSE video ... Fixed CSS Cascade Layers specified in import rules...
Read more >
Responsive event calendar documentation for Javascript
Schedule view. The scheduler displays a time grid with its related events. It can be configured as a daily or weekly schedule. Work...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found