Opened 12 years ago

Closed 12 years ago

#3871 closed defect (invalid)

Tree selection broken due to onblur and dojo.html.toggleShowing

Reported by: guest Owned by: bill
Priority: high Milestone:
Component: Dijit Version: 0.4.2
Keywords: Cc: rhys@…
Blocked By: Blocking:

Description

We've encountered this problem in 0.4.3, but it may be present in later releases. I'm unsure how to translate the test scenario into 0.9.x-speak.

I will attach a test file that uses AOL's CDN to load dojo 0.4.3.

The scenario contains a TreeV3 widget and an HTML text box. For the TreeV3's TreeSelectorV3, dojo.event.topic.subscribe causes a debug statement to be printed on each node selection. For the text box, blur events cause a debug statement and they hide/show some textual content above the tree.

We're seeing that, from focus within the text box, clicking directly on the tree triggers onblur and hides/shows the text content, but it never triggers the tree selection event.

If the onblur doesn't trigger the hide/show (comment out the line in the test file), then the tree selection event does fire.

Our expectation is that showing/hiding the textual content will not effect whether or not the tree selection event fires.

This is reproducible in IE7 and FF2.

Attachments (2)

dojo recreate for 13187.html (3.4 KB) - added by guest 12 years ago.
nodojo13187.html (2.3 KB) - added by guest 12 years ago.

Download all attachments as: .zip

Change History (8)

Changed 12 years ago by guest

comment:1 Changed 12 years ago by guest

If, in the course of investigating this, you find any workarounds please let me know.

comment:2 Changed 12 years ago by guest

For FF2: The same problem exists if I connect to 'onchange' instead of 'onblur'. Connecting around or after the onblur shows the same behavior. Setting a timeout to delay the toggleShowing call, e.g. dojo.lang.setTimeout(dojo.html.toggleShowing, 250, dojo.byId('someContent')) works but is sensitive to the delay used.

comment:3 Changed 12 years ago by guest

For FF2: Using toggleVisibility instead of toggleShowing does behave as expected. Having the hidden/shown block placed below the tree works as expected.

Changed 12 years ago by guest

Attachment: nodojo13187.html added

comment:4 Changed 12 years ago by guest

Added attachment nodojo13187 which reproduces the problem without dojo in FF2. The recreate breaks on IE7.

Looks like this is either me not understanding how onblur and onclick interact with each other, or else it's a browser bug.

comment:6 Changed 12 years ago by bill

Resolution: invalid
Status: newclosed

Looks like this is neither a dojo nor a mozilla bug but your misunderstanding. The onclick event happens on mouse up , and since the element you are pressing moves while the mouse is down, it never receives the mouse up event. (At the point that you release the mouse button the cursor is no longer over a different element.)

Note: See TracTickets for help on using tickets.