Opened 14 years ago
Closed 12 years ago
#5284 closed bug (fixed)
Position: Smarter collision detection
Reported by: | Scott González | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.9.0 |
Component: | ui.position | Version: | 1.8 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Collision detection needs to be smart enough to never make the situation worse. Flipping should only happen if more of the element will be visible after the flip. Fitting should only shift until the maximum possible amount of the element is visible.
Change History (8)
comment:1 Changed 14 years ago by
Version: | 1.7.2 → 1.8 |
---|
comment:2 Changed 14 years ago by
Created a visual testcase for Position: http://github.com/jquery/jquery-ui/blob/304a45c159f168f2fabb0167e36f243d7a95bf1e/tests/visual/position/default.html
comment:3 Changed 13 years ago by
Improved that testcase a bit further: http://github.com/jquery/jquery-ui/commit/3f45f5ccf93853e9f309cdb052dc47d88e393516
It shows quite nicely one of the problems we have: http://view.jqueryui.com/master/tests/visual/position/position.html The three menus on the right should be with the right corner on the inputs right corner.
Also: Setting collision: "fit" makes that test much worse. The bottom menus will actually end up overlapping their inputs.
comment:4 Changed 13 years ago by
Milestone: | 1.next → 1.9 |
---|---|
Type: | enhancement → bug |
comment:5 Changed 13 years ago by
I fixed the problem with the "flip" collision that caused the menus on the right to not align correctly: http://github.com/bhollis/jquery-ui/commit/22797e5f1fbd731123a23405d5fd26342cada739
That commit also fixes a problem in the demo when you set both positions to "right bottom" then try to drag the orange element towards the top of the screen: http://jqueryui.com/demos/position/default.html
comment:6 Changed 13 years ago by
Priority: | critical → major |
---|
comment:7 Changed 12 years ago by
Landed in master, needs some more testing to verify it covers everything we want.
comment:8 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
We should create a testpage with four inputs, each in one corner, and position a menu based on the autocomplete-default for each input. Then you actually have to shrink the browser window to test, as position always does collision-detection against window - there is no way to specify a container against which to test.