Skip to content
Permalink
Browse files

Position: Handle sub-pixel offsets better in Firefox. Fixes #6000 - P…

…osition: Sometimes positioning is off by 1px in Firefox.
  • Loading branch information...
scottgonzalez committed Oct 22, 2010
1 parent 19f9c3a commit 32264f7ad12609b316189fd013cda63b41c8b271
Showing with 2 additions and 2 deletions.
  1. +2 −2 ui/jquery.ui.position.js
@@ -122,8 +122,8 @@ $.fn.position = function( options ) {
}

// prevent fractions (see #5280)
position.left = parseInt( position.left );
position.top = parseInt( position.top );
position.left = Math.round( position.left );
position.top = Math.round( position.top );

collisionPosition = {
left: position.left - marginLeft,

1 comment on commit 32264f7

@jitter

This comment has been minimized.

Copy link

commented on 32264f7 Oct 22, 2010

This changes breaks another few dialog-unit-tests across all browsers. All seem to be 1px off failures.

When fixing this maybe you find time to fix a long-standing bug over all Opera versions. Using position bottom on a dialog on a page where the content doesn't fit into the visible area (has vertical scrollbars) and where the dialog itself has no focusable content makes Opera scroll the page.

e.g.
http://jsbin.com/atesu3/2 (page scrolls)
http://jsbin.com/atesu3/3 (everything fine page can't scroll - if window large enough)
http://jsbin.com/atesu3/4 (everything fine page doesn't scroll as input captures the focus and the focus-bubbling to body doesn't trigger the bug)

The same problem actually happens if I recall correctly in all directions (top, left, right) if the browser window can be scrolled in that direction

Please sign in to comment.
You can’t perform that action at this time.