Ticket #5766 (closed bug: fixed)
position: collision should take margin into account
| Reported by: | bhollis | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 1.8.5 |
| Component: | ui.position | Version: | 1.8.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
The position utility should take into account margins when performing collisions (or offer some other way of offsetting the collision box from the element itself). This way you could prevent positioned elements from getting too close to the edge of the screen. This is especially useful when the positioned element uses -moz-box-shadow, since a shadow that falls outside the page will cause scrollbars.
Change History
comment:2 Changed 3 years ago by bhollis
I'd really love to see this patch committed - without it there's no good way to use drop shadows on positioned elements or pop stuff up that doesn't go to the exact edge of the screen.
comment:3 Changed 3 years ago by joern.zaefferer
- Priority changed from minor to major
- Type changed from enhancement to bug
- Milestone changed from TBD to 1.9
Tested that commit. Testsuite fails on IE8.
comment:4 Changed 3 years ago by bhollis
Sorry about that! I've fixed this in http://github.com/bhollis/jquery-ui/commit/e9ce8e7b60644f9fb504d2e9684bd61f8c97388d
comment:5 Changed 3 years ago by bhollis
I rebased the IE8 fix and the original patch together into one commit on top of the latest master if that makes it easier to pull: http://github.com/bhollis/jquery-ui/commit/118a2f86a1c74ab5f42a1700512ec33667296f12
comment:6 Changed 3 years ago by scott.gonzalez
- Status changed from new to closed
- Resolution set to fixed
Fixed in 4b9d5d1. Thanks bhollis.
comment:8 Changed 2 years ago by Ben Hollis
Position: Take margin into account when performing collisions. Fixes #5766 - position: collision should take margin into account.
Changeset: 4b9d5d1b5bd36726c6e49b105c0f75649cca1ae4


I addressed this in http://github.com/bhollis/jquery-ui/commit/d2ffcac0adb79c3415ec3148f604f9de15c7cf0a and have sent a pull request.