Opened 6 years ago

Closed 6 years ago

#16754 closed defect (wontfix)

[regression] SPACE key causes scrolling but ENTER does not when antikeylogger installed

Reported by: Douglas Hays Owned by: Douglas Hays
Priority: high Milestone: tbd
Component: Dijit Version: 1.8.3
Keywords: Cc:
Blocked By: Blocking: #16743

Description

Load test_Select.html (fails in both Chrome 24 and IE 9).
On any Select widget click the down arrow to show the dropdown, and press ESC to close.
Press the ENTER key and note it opens and is positioned properly and again close with ESC.
Type a SPACE and note weird scrolling and the Select widget is off the screen.
This worked properly in 1.7 but was regressed starting with [29331] in 1.8.

Change History (11)

comment:1 Changed 6 years ago by Douglas Hays

Priority: undecidedhigh

comment:2 Changed 6 years ago by Douglas Hays

Blocking: 16743 added

comment:3 Changed 6 years ago by bill

Owner: changed from bill to Douglas Hays
Status: newpending

It sounds similar to previous bugs with buttons, in which you need an evt.preventDefault() to stop native browser scrolling, especially when the main window is scrolled at the time you press SPACE. Probably it needs to be on keypress in addition to keydown.

However, http://download.dojotoolkit.org/release-1.8.3/dojo-release-1.8.3/dijit/tests/form/test_Select.html is working fine for me on IE9, as is the latest on trunk and the latest on the 1.8 branch, and also trunk at [29931].

Also, I doubt this is blocking #16743 since in 1.9 SPACE should no longer open/close the dropdown, but rather should contribute to the search text, so _KeyNavMixin should have the evt.preventDefault() in _onContainerKeypress().

comment:4 Changed 6 years ago by Douglas Hays

Status: pendingnew

The provided 1.8.3 URL is failing for me on a separate machine on Chrome and IE8. Not only does the Select scroll up but the dropdown appears as well contrary to the comment about how space no longer opens the dropdown.

Last edited 6 years ago by Douglas Hays (previous) (diff)

comment:5 Changed 6 years ago by bill

OK, but it's working for me. You can try to debug it on your end if you want, but as I said above, it will no longer be an issue if you fix #16743 by disabling SPACE key from opening the drop down. (If however, you let SPACE open the dropdown except when there's an ongoing search, then it will presumably still be an issue.)

comment:6 Changed 6 years ago by bill

PS: you should currently be hitting the following code in _HasDropDown, which will call evt.preventDefault() on the SPACE key:

}else if(!this._opened &&
	(e.keyCode == keys.DOWN_ARROW ||
		( (e.keyCode == keys.ENTER || e.keyCode == keys.SPACE) &&
			//ignore enter and space if the event is for a text input
			((target.tagName || "").toLowerCase() !== 'input' ||
				(target.type && target.type.toLowerCase() !== 'text'))))){
	// Toggle the drop down, but wait until keyup so that the drop down doesn't
	// get a stray keyup event, or in the case of key-repeat (because user held
	// down key for too long), stray keydown events
	this._toggleOnKeyUp = true;
	e.stopPropagation();
	e.preventDefault();
}

If that is running than presumably you are hitting a different issue than the browser scrolling natively.

comment:7 Changed 6 years ago by Douglas Hays

I see the same broken scrolling behavior after pressing SPACE on a focused DropDownButton

comment:8 Changed 6 years ago by Douglas Hays

On a test system with an antikeylogger installed, keypress is occurring before keydown and a11yclick::preventDefault is too late.

comment:9 Changed 6 years ago by Douglas Hays

In a11yclick.js and _HasDropDown.js, changing "keydown" to "keydown, keypress" seems to fix this (if we want to support this). The issue is that this configuration worked in 1.7 and before.

comment:10 Changed 6 years ago by bill

Summary: [regression] SPACE key causes scrolling but ENTER does not[regression] SPACE key causes scrolling but ENTER does not when antikeylogger installed

OK, that explains why I couldn't see this and no one else has reported it. It's strange the anti-key-logging software would switch the order of the events. Which antikeylogger sofware are you referring to, or are you saying that they all cause the problem?

My main concern is degrading performance by adding more event handlers to the code. Admittedly, a11yclick.js already creates an absurd number of event handlers per node.

comment:11 Changed 6 years ago by Douglas Hays

Resolution: wontfix
Status: newclosed

Fixed in 3rd party software.

Note: See TracTickets for help on using tickets.