Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The selected day doesn't scroll into correct position in list view #80

Open
timelapse999 opened this issue Feb 7, 2018 · 1 comment

Comments

@timelapse999
Copy link

When you click a day in the calendar view and get into to list view, the list doesn't scroll into correct position. (At least in Chrome 63.0.3239.132).

I found out the element offset is taken before the element becomes visible, so it will remain '0' instead of the correct value.

Here's my simple, basically one line, fix for monthly.js:

// Click A Day
	$(document.body).on("click touchstart", parent + " .monthly-day", function (event) {
		// If events, show events list
		var whichDay = $(this).data("number");
		if(options.mode === "event" && options.eventList) {
			var theList = $(parent + " .monthly-event-list"),

                              //line can end here
			      myElement = document.getElementById(uniqueId + "day" + whichDay);

                              //from the original
		              //topPos = myElement.offsetTop; 

			theList.show();
			theList.css("transform");
			theList.css("transform", "scale(1)");
			$(parent + ' .monthly-list-item[data-number="' + whichDay + '"]').show();

                        //from the original, gave offset value of '0'
			//theList.scrollTop(topPos); 

                        //fix, the only required change, gives the correct offset value
			theList.scrollTop(myElement.offsetTop);

			viewToggleButton();
			if(!options.linkCalendarToEventUrl) {
				event.preventDefault();
			}

@kthornbloom
Copy link
Owner

Thanks! That bug has been bugging me as well. I'll get this added soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants