Opened 9 years ago

Closed 7 years ago

#16644 closed defect (wontfix)

dojox.drawing incorrectly connects key listeners to entire document

Reported by: bdmayes Owned by: dylan
Priority: low Milestone: 2.0
Component: DojoX Drawing Version: 1.8.3
Keywords: Cc:
Blocked By: Blocking:


It appears that the dojox.drawing module incorrectly handles keyboard event listeners. The problem appears to be rooted in dojo/dojox/drawing/manager/keys.js. In version 1.8.3 the offending lines are 162, 168, 192, and 232.

Because the listeners are connected to "document", it intercepts keyboard events fired by other, completely unrelated HTML elements and causes incorrect behavior because it "handles" the event by stopping it. I am attaching an SSCCE that demonstrates this.

Due to the inclusion of the dojox.drawing module, certain keys no longer have any effect in the textarea. Some keys that are known not to work (there may be others):

  • backspace
  • delete
  • arrow keys
  • space (depending on browser)

It makes it impossible to type or edit text in the textarea in any meaningful way. If you simply comment out the require statement then the textarea will work correctly.

Instead of connecting the keyboard events to document, maybe the code in keys.js should connect to this? I'm not 100% certain that "this" is the correct object but "document" certainly seems wrong.

Attachments (1)

sscce.html (615 bytes) - added by bdmayes 9 years ago.
simple HTML to demonstrate the problem

Download all attachments as: .zip

Change History (4)

Changed 9 years ago by bdmayes

Attachment: sscce.html added

simple HTML to demonstrate the problem

comment:1 Changed 9 years ago by dylan

Milestone: tbd1.9
Owner: changed from Mike Wilcox to dylan
Priority: undecidedlow
Status: newassigned

comment:2 Changed 9 years ago by dylan

Milestone: 1.92.0

Because key events are generally bound to a document element (since they aren't usually associated with a particular DOM node), this one is particularly challenging to solve without completely rewriting dojox/drawing.

I looked for several simple fixes (e.g. passing in a dom node), etc., but none of these options appear likely to work.

Unfortunately, I need to punt this to 2.0, at which time dojox/drawing should be split out to a separate project on GitHub?.

comment:3 Changed 7 years ago by dylan

Resolution: wontfix
Status: assignedclosed

dojox/drawing is currently in an abandoned state. Closing this out, unless someone wants to take this on for Dojo 2.

Note: See TracTickets for help on using tickets.