Opened 6 years ago

Closed 3 years ago

#17281 closed defect (fixed)

[patch][cla] on.selector matchesTarget.matches is not a function

Reported by: iCanDo Owned by: dylan
Priority: undecided Milestone: 1.10.5
Component: Events Version: 1.9.1
Keywords: Cc:
Blocked By: Blocking:

Description

The line 187 in on.js

matchesTarget = matchesTarget && matchesTarget.matches ? matchesTarget : dojo.query;

sometimes produces error of type "matchesTarget.matches is not a function".

This change fix the error:

matchesTarget = matchesTarget && typeof matchesTarget.matches == "function" ? matchesTarget : dojo.query;

Change History (5)

comment:1 Changed 3 years ago by dylan

Milestone: tbd1.11
Owner: set to iCanDo
Status: newpending

Hmmm, I thought this bug was typically the result of forgetting to require dojo/query as a dependency when doing event delegation, e.g. https://www.sitepen.com/blog/2012/10/31/debugging-dojo-common-error-messages/#forgot-dojo-query

Is there another condition where you're actually seeing this issue iDo?

comment:2 Changed 3 years ago by iCanDo

Status: pendingnew

Only 0.0005% of the Firefox and Chrome visitors hit the error.

Firefox 21-22: TypeError?: s.matches is not a function

Chrome 27: Uncaught TypeError?: Property 'matches' of object [object global] is not a function

comment:3 Changed 3 years ago by dylan

Summary: on.selector matchesTarget.matches is not a function[patch][cla] on.selector matchesTarget.matches is not a function

comment:4 Changed 3 years ago by dylan

Owner: changed from iCanDo to dylan
Status: newassigned

comment:5 Changed 3 years ago by dylan

Milestone: 1.111.10.5
Resolution: fixed
Status: assignedclosed

Fixed in https://github.com/dojo/dojo/commit/a19a1c7aca0ce5fe473c848210077bbbd3955698 , backported as https://github.com/dojo/dojo/commit/71ef096d7f0829dfcaa5a5dfbf3e8f739d9aa478 . Did not cleanly apply prior to 1.10, so I stopped there. If you need it further backported, please create a PR against 1.9.

Note: See TracTickets for help on using tickets.