Opened 10 years ago
Closed 9 years ago
#10873 closed defect (fixed)
Tooltip position 'below' overrides either 'after' or 'before' - hash collision
Reported by: | Tom Shinnick | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | 1.7 |
Component: | Dijit | Version: | 1.4.2 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Observed that when the Tooltip defaultPosition array contained 'below', that 'after' and 'before' never seemed to take affect, and when 'below' was definitely the last item in the array. After discovering the cause, verified that the ordering ['before', 'below', 'after'] allowed 'after' to sometimes work, but 'before' never did!
Routine dijit.getPopupAroundAlignment in dijit/_base/place.js is broken. The keys used to translate 'after' and 'before' ("BR","BL") are _also_ used by 'below' which uses _both_ "BR" and "BL"! Having 'below' in the input list position erases any preceding 'after' or 'before'.
BTW: Routine dijit.getPopupAlignment is a complete duplicate of Routine dijit.getPopupAroundAlignment, and is never used anywhere within the 1.4.2 release.
Change History (5)
comment:1 Changed 10 years ago by
Milestone: | tbd → 2.0 |
---|
comment:2 Changed 10 years ago by
comment:3 Changed 9 years ago by
Milestone: | 2.0 → 1.7 |
---|---|
Owner: | set to bill |
Status: | new → assigned |
comment:4 Changed 9 years ago by
New API for place.around() (see #12728) takes an array rather than a hash, avoiding this problem.
comment:5 Changed 9 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Thanks for the report. That's strange about dijit.getPopupAlignment() and dijit.getPopupAroundAlignment() being the same code, not sure what happened there.
About the main issue, where you you can't specify both "after"/"before" and "below" as tooltip positions, I agree it's broken but I don't see a way to fix it w/out making a technically backwards-incompatible change. The return value from dijit.getPopupAlignment(), and also the orient argument to dijit.popup(), is an object representing a list of ordered tuples but (as you know) the problem is that the tuple-list is stored as a hash, thus not allowing two tuples that start with the same value.
For 2.0, I'll change it to a format that does allow duplicates like
[ ["TR, "TL"], ["TL", "BR"], ...]
.