Search and Top Navigation
#7819 closed bug (notabug)
Opened October 27, 2011 10:38PM UTC
Closed October 28, 2011 12:11AM UTC
positon() does not work when div contains multiple spans
Reported by: | JVerstry | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.9.0 |
Component: | ui.position | Version: | 1.8.16 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Following a question I asked on StackOverflow (http://stackoverflow.com/questions/7922023/jquery-ui-position-issue-with-a-div-within-a-div-containing-spans), it seems like there is a bug in the position() method when trying to position a div containing spans, within another div.
If each spans is not followed by a <br /> (except for the last one), the position() method does not work. There is no error message thrown by FireBug and I a could not find any documentation related to this. Setting a value for collision does not help.
The SO question contains screenshots and code samples.
Attachments (0)
Change History (3)
Changed October 27, 2011 10:55PM UTC by comment:1
Changed October 27, 2011 11:53PM UTC by comment:2
After discussions in the SO question, someone found out that the enclosing div MUST have an explicit height or width. This is not mentioned in the documentation.
Changed October 28, 2011 12:11AM UTC by comment:3
component: | ui.core → ui.position |
---|---|
resolution: | → invalid |
status: | new → closed |
That's because your elements are all floated, so they don't have the dimensions that you think they have.
I have create a code example at: http://jsfiddle.net/bHssw/.
In this example, even if I add a <br /> after each span, it does not solve the issue.