Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#18632 closed defect (duplicate)

Click events suppressed on touch devices when hosted in dijit popup

Reported by: neville1355 Owned by: bill
Priority: undecided Milestone: tbd
Component: Dijit Version: 1.10.4
Keywords: Cc:
Blocked By: Blocking:

Description

We discovered this as a regression when we upgraded from dojo 1.9.2 to dojo 1.10.4

We have many popups in our application with <a> links in which we listen to the click event to progress to another area of our application.

As of dojo 1.10.4, we are no longer receiving click events from touch devices when tapping on the links.

Using a11yclick is a valid workaround for now but this have broken a lot of our application for touch devices as we lean on primitive javascript events.

The offending line of code is in popup.js in _createWrapper():

// Workaround iOS problem where clicking a Menu can focus an <input> (or click a button) behind it.
// Need to be careful though that you can still focus <input>'s and click <button>'s in a TooltipDialog.
// Also, be careful not to break (native) scrolling of dropdown like ComboBox's options list.
if("ontouchend" in document) {
	on(wrapper, "touchend", function (evt){
		if(!/^(input|button|textarea)$/i.test(evt.target.tagName)) {
			evt.preventDefault(); //<== this line stops click events from the popup's content
		}
	});
}

I have attached a test case to reproduce this issue. It has a tooltip dialog that displays on hover and has an <a> inside that should display an alert on click. On 1.9.2 this works, on 1.10.4 no alert is display when tapping the node via touch screen.

Attachments (1)

DojoPopupTouchBug.html (1.7 KB) - added by neville1355 4 years ago.
test case to repro the issue

Download all attachments as: .zip

Change History (4)

Changed 4 years ago by neville1355

Attachment: DojoPopupTouchBug.html added

test case to repro the issue

comment:1 Changed 4 years ago by bill

Resolution: duplicate
Status: newclosed

Duplicate of #18621.
This has already been fixed.

Note however that fake <a> tags are a big no-no since they cause weird phantom events in older versions of IE.

comment:2 Changed 4 years ago by neville1355

Thanks Bill,

Will there be a new bug-fix release of dojo 1.10 with these changes or should I back-port the same fix to our local CDN?

comment:3 Changed 4 years ago by dylan

There will be a new 1.10.x release sometime soon (in the next 1-3 months).

Note: See TracTickets for help on using tickets.