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.

CSS Zoom on Body causes inaccurate selectable

See original GitHub issue

Originally reported on Google Code with ID 2227

Hello,

Tested on the latest 2.1.0 Beta download.

When adding any zoom to the entire body e.g. "<style>body{zoom:0.85;}</style>" the
selection goes off.

For example when making zoom: 0.85; and attempting to select June 18 2014 it selects
June 10 2014 on the month view, similar occurrence on the day and week view.

Note that it occurs when going both above/below 1.00 zoom level.

To replicate you can add "zoom: 0.85;" to the body css tag in the selectable.html demo
that comes with the download.

Thanks!

Reported by prggmr on 2014-08-06 16:55:26

Imported with 1 stars.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
stephentissotcommented, Jan 17, 2017

Hello. I’ve also get this bug with last current version (3.1.0). I think I found a very simple way to make this work :

In FullCalendar.js I update the 2 functions getEvX(ev) and function getEvY(ev) like this :

function getEvX(ev) {
	if (ev.pageX !== undefined) {
	    return ev.pageX / Number($('body').css('zoom'));
	}
	var touches = ev.originalEvent.touches;
	if (touches) {
	    return touches[0].pageX / Number($('body').css('zoom'));
	}
}


function getEvY(ev) {
	if (ev.pageY !== undefined) {
	    return ev.pageY / Number($('body').css('zoom'));
	}
	var touches = ev.originalEvent.touches;
	if (touches) {
	    return touches[0].pageY / Number($('body').css('zoom'));
	}
}
1reaction
SuperMario77commented, Nov 20, 2020

@arshaw

We have the same zoom issue here in a productive app. And this zoom issue is still reproducible in latest version 5.4.0.

You can still reproduce it by following this link: https://fullcalendar.io/reduced-test-cases

  • Then select "Fullcalendar v5 Standard CodePen.
  • Then add “selectable: true” to the fullCalendar options in “JS” panel
  • Then change the page div in “HTML” panel to <div style='zoom: 0.8' id='calendar'></div>

Now, if you try to select a date range with the left mouse button, the selected blue area is way off the mouse pointer position.

Read more comments on GitHub >

github_iconTop Results From Across the Web

html layout messed up when i zoom in or out - Stack Overflow
The reason that it's broken the layout like that is because you're using percentages so that means when you're changing the zoom level...
Read more >
zoom | CSS-Tricks
The zoom property in CSS allows you to scale your content. It is non-standard, and was originally implemented only in Internet Explorer.
Read more >
zoom - CSS: Cascading Style Sheets - MDN Web Docs
The non-standard zoom CSS property can be used to control the magnification level of an element. transform: scale() should be used instead ...
Read more >
My websites layout gets messed up when I zoom in or out!
As I want the website that i am creating to only be used on desktop displays with similar sizes would i need to...
Read more >
Enhancing The Clickable Area Size - Ahmad Shadeed
This happens because the clickable area is not applied to the whole element. To make it more clear, see the below figure.
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 Reddit Thread

No results found

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