Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#2044 closed defect (fixed)

Menu2: separator appears in wrong position

Reported by: bill Owned by: bill
Priority: high Milestone:
Component: Widgets Version: 0.4.1rc1
Keywords: Cc:
Blocked By: Blocking:

Description

In test_Menu2.html, right click to see the menu. Menu2Separator should be after "Paste" menu item, but is shows up before "Paste" menu item. Bizarre. Occurs on IE and FF.

Change History (6)

comment:1 Changed 13 years ago by shaneosullivan1@…

The problem here is in the DomWidget?.js file, in the addWidgetAsDirectChild function. The problem is that when it uses the insertIndex argument, it takes this to mean the index in the list of DOM nodes, rather than it's index in the list of child widgets.

Since a child widget's template can contain multiple DOM nodes (even something as simple as a blank space <text> node even), the insertIndex is incorrect.

The solution is, in the

if(pos=='insertAtIndex')

code block, search the children widgets of 'this' widget to find the first widget whose 'dojoInsertionIndex' variable is greater than the widget being inserted, and insert the domNode before the found widget's domNode.

This way it is treating the insertIndex as meaning the insertion index in the list of child widgets rather than the index in the list of Dom nodes, which cannot of course be predicted.

comment:2 Changed 13 years ago by bill

Milestone: 0.5
Status: newassigned

The idea that one widget could have multiple DOM nodes is troubling, especially since we only have a pointer to one of the dom nodes (Widget.domNode). How is it that a widget can have multiple top-level DOM nodes?

comment:3 Changed 13 years ago by bill

Talked to Shane and researched this; there's a bug that when snarfChildDomOutput is true, (for each MenuItem?) both the source HTML and the generated HTML get copied underneath the Menu's <tbody> container node. So the <tbody> contains <div> nodes in addition to the <tr> nodes (and then chaos ensues).

comment:4 Changed 12 years ago by bill

Milestone: 0.90.4.2

comment:5 Changed 12 years ago by bill

Resolution: fixed
Status: assignedclosed

Fixed by [7110]

comment:6 Changed 12 years ago by (none)

Milestone: 0.4.2

Milestone 0.4.2 deleted

Note: See TracTickets for help on using tickets.