Opened 7 years ago

Closed 7 years ago

#16292 closed defect (fixed)

item passed in event differs between Mouse and Touch for dojos/calendar/Calendar

Reported by: sgevers Owned by: cjolif
Priority: undecided Milestone: 1.8.2
Component: Dojox Version: 1.8.1
Keywords: Cc: dg
Blocked By: Blocking:

Description

The item passed to the onItemClick event from the Touch mixin does not contain the same properties as the one passed from the Mouse mixin. Looking at the source, the Mouse mixin uses the function renderItemToItem function to create the item that is passed to the event handler (Mouse.js: line 63). The Touch mixin uses itemToRenderItem to create the item that is passed to the event handler (Touch.js: line 317). The latter function appears to be intended for display purposes and does not contain all of the properties found on the original item in the store.

I'm attaching an example. The CalendarBug?.js file is a copy of dojox/calendar/Calendar.js with Touch added to the set of base classes mixed in at line 32. Cal.js is a simple widget that creates an instance of CalendarBug? and adds a handler for itemClicked. The calendar is created with a Memory store that contains one item. The one item has a property named "extraInfo". The handler simply creates an alert that shows the value of the item's extraInfo property.

When this example is run on a desktop browser, and the item is clicked, the alert contains the string "extraInfo" (which is the value of the extraInfo property). When run on a mobile device, the alert contains "undefined"

Attachments (3)

Cal.html (1.2 KB) - added by sgevers 7 years ago.
HTML for example
Cal.js (757 bytes) - added by sgevers 7 years ago.
Driver JS
CalendarBug.js (2.6 KB) - added by sgevers 7 years ago.
dojox/calendar/Calendar with Touch mixed in

Download all attachments as: .zip

Change History (7)

Changed 7 years ago by sgevers

Attachment: Cal.html added

HTML for example

Changed 7 years ago by sgevers

Attachment: Cal.js added

Driver JS

Changed 7 years ago by sgevers

Attachment: CalendarBug.js added

dojox/calendar/Calendar with Touch mixed in

comment:1 Changed 7 years ago by Adam Peller

Owner: changed from Adam Peller to cjolif
Status: newassigned

comment:2 Changed 7 years ago by cjolif

Cc: dg added

comment:3 Changed 7 years ago by cjolif

Milestone: tbd1.8.2

comment:4 Changed 7 years ago by cjolif

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.