Opened 12 years ago

Closed 11 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:


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 12 years ago by bill

Milestone: tbd2.0

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"], ...].

comment:2 Changed 12 years ago by bill

(In [21663]) Remove duplicated function definition from [19513], refs #5854, #10873.

comment:3 Changed 11 years ago by bill

Milestone: 2.01.7
Owner: set to bill
Status: newassigned

comment:4 Changed 11 years ago by bill

New API for place.around() (see #12728) takes an array rather than a hash, avoiding this problem.

comment:5 Changed 11 years ago by bill

Resolution: fixed
Status: assignedclosed

(In [24405]) create dijit/place module based on (deprecated) dijit/_base/place, fixes #12728, #10873.

Note: See TracTickets for help on using tickets.