Opened 6 years ago

Closed 3 years ago

#17332 closed defect (invalid)

window and document can't emit events using on.emit

Reported by: eduardo matos Owned by: eduardo matos
Priority: undecided Milestone: 1.11
Component: Events Version: 1.9.1
Keywords: Cc:
Blocked By: Blocking:

Description

When trying to emit events on 'window' and 'document' objects using on.emit, an error is thrown.

You can see it at http://jsfiddle.net/ExTX8/2/

require([
    'dojo/on'
], function (
    on
) {
    // TypeError: Cannot call method 'createEvent' of null
    on.emit(document, 'click', {bubbles: true});
});

require([
    'dojo/on'
], function (
    on
) {
    // TypeError: Cannot call method 'createEvent' of undefined
    on.emit(window, 'click', {bubbles: true});
});

Change History (4)

comment:1 Changed 6 years ago by bill

Owner: set to Kris Zyp
Status: newassigned

comment:2 Changed 6 years ago by gaurav21r

Please merge the Pull Request https://github.com/dojo/dojo/pull/16

Last edited 6 years ago by gaurav21r (previous) (diff)

comment:3 Changed 3 years ago by dylan

Milestone: tbd1.11
Owner: changed from Kris Zyp to eduardo matos
Status: assignedpending

pull request was merged a while back, but I think only for the rest? Is there anything that remains to be done with this ticket?

comment:4 Changed 3 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

Note: See TracTickets for help on using tickets.