Bug Tracker

Opened 6 years ago

Closed 6 years ago

#14742 closed bug (cantfix)

offset() and position() returns different value after touch gesture zoom in IE 10 and 11

Reported by: victor.huang@… Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.9.0
Keywords: Cc:
Blocked by: Blocking:

Description

When using offset() and position() to get the left and top value, the value changes after zoom in IE 10 and 11. This issue always occurs in Metro IE 10 and 11, and only occurs in desktop IE 10 and 11 when zooming using touch gesture. Using keyboard zoom (Ctrl + "+"/"-") gives correct behaviour.

Tested on other browsers (i.e. Firefox, Safari, Chrome) and value did not change.

Tested with jQuery 1.9.0 and 1.11.0 and both reproduced the error.

Demo code below:

<!DOCTYPE html>
<html>
<head>
	<title>Demo</title>
	<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
</head>
<body>
	<div style="padding-left: 100px;">
		<h3>Signature Pad demo</h3>
		<button id="testBtn" onclick="testOffset();">Test offset</button>
		<p id="testOutput"></p>
		<script>
		function testOffset()
		{
			var offset = $("#testBtn").position();
			
			var str = "left=" + offset.left + "<br />" + "top=" + offset.top;
			$("#testOutput").html(str);
		}
		</script>
	</div>
</body>
</html>

Try it with Metro IE 10 or 11. Click on the button before zooming to get the original value, and then zoom and move the page. Clicking the button will change the value every time the page is zoomed/moved. This behaviour will also happen when using tough gesture zoom on desktop version IE 10 and 11.

Change History (4)

comment:1 Changed 6 years ago by dmethvin

Unfortunately I don't think any browser gives good position/offset results when the page is zoomed, and doesn't expose any scaling factor to let us determine the right values. This has existed forever and I've got a PR to address it that should land soon. https://github.com/jquery/api.jquery.com/issues/76

comment:2 in reply to:  1 Changed 6 years ago by victor.huang@…

Replying to dmethvin:

Unfortunately I don't think any browser gives good position/offset results when the page is zoomed, and doesn't expose any scaling factor to let us determine the right values. This has existed forever and I've got a PR to address it that should land soon. https://github.com/jquery/api.jquery.com/issues/76

Thanks for the info. Is there any workaround to accommodate for this behavior in IE 10/11 at the moment?

comment:3 Changed 6 years ago by dmethvin

No workaround that I know of. If you could get correct information then jQuery could as well.

comment:4 Changed 6 years ago by dmethvin

Resolution: cantfix
Status: newclosed
Note: See TracTickets for help on using tickets.