Opened 3 years ago

Closed 3 years ago

#18823 closed defect (worksforme)

'KeyboardEvent.keyLocation' is deprecated with onkeyPress event

Reported by: mosi Owned by: dylan
Priority: undecided Milestone: tbd
Component: Events Version: 1.11.0
Keywords: Cc:
Blocked By: Blocking:

Description

Chrome is reporting warning:

'KeyboardEvent.keyLocation' is deprecated and will be removed in M50, 
around April 2016. Please use 'KeyboardEvent.location' instead. 
See https://www.chromestatus.com/features/4997403308457984
 for more details.

which is caused once you are trying to use on() module to connect 'onKeyPress' event. The issue is presented in 1.11.0 version.

Currently as a workaround I'm using directly javascript browser function

_attachEvent: function(domNode, eventName, callback)
{
	if (domNode.addEventListener) 
	{
		// For all major browsers, except IE 8 and earlier
		domNode.addEventListener(eventName, callback);
	}
	else if (domNode.attachEvent) 
	{ 
		// For IE 8 and earlier versions
		domNode.attachEvent(eventName, callback);
	}
}

Also see attached test html

Attachments (1)

testPage.html (1.5 KB) - added by mosi 3 years ago.
TestPage?

Download all attachments as: .zip

Change History (5)

Changed 3 years ago by mosi

Attachment: testPage.html added

comment:1 Changed 3 years ago by bill

I don't see any reference to keyLocation in the code. My guess is that we are just copying all the properties from the event object, thus triggering this warning. If so, the error should go away sometime this month, when M50 is released.

Last edited 3 years ago by bill (previous) (diff)

comment:2 in reply to:  1 Changed 3 years ago by mosi

I'm not aware of any copy action of event object but this appears when you start typing something into ComboBox?.

Replying to bill:

I don't see any reference to keyLocation in the code. My guess is that we are just copying all the properties from the event object, thus triggering this warning. If so, the error should go away sometime this month, when M50 is released.

comment:3 Changed 3 years ago by bill

Actually it doesn't happen for me on Combobox, testing on dijit/tests/form/test_Combobox.html on Chrome 49 on mac, with the latest in the 1.11 branch.

comment:4 Changed 3 years ago by bill

Resolution: worksforme
Status: newclosed

Plus which, Chrome 50 was just released, so probably this warning isn't occurring for you anymore. In any case, http://download.dojotoolkit.org/release-1.11.0/dojo-release-1.11.0/dijit/tests/form/test_ComboBox.html is working fine for me on Chrome 50.

Note: See TracTickets for help on using tickets.