PDA

View Full Version : [OPEN-200] HTML Hyperlinks Not Working on Android



graham_alton
5 Aug 2010, 1:02 AM
Sencha Touch version tested:


0.9 rev 3



only default ext-all.css





Platform tested against:


iOS (on friends iPhone, not sure which iOS version)
Android 2.1 (on HTC Desire)
Webkit Browsers (Midori and Chrome)



Description:


Inserting hyperlinks into panels does not work as expected on Android.
Hyerlinks should be clickable to go to the link location in the web browser. This is working on iPhone and webkit browsers I've tried but does not work for Android 2.1 on my HTC Desire.



Test Case:



Ext.setup({
onReady: function () {
window.panel = new Ext.Panel({
fullscreen: true,
html: 'Why not have a look at <a href="http://www.sencha.com">Sencha</a>.',
});
}
});


Steps to reproduce the problem:


Run the simple test case above.



The result that was expected:


Hyperlink is clickable on iPhone and webkit browsers but not on Android 2.1.



The result that occurs instead:


Clicking the link on Android 2.1 has no effect.
Behaviour should be the same as seen on iPhone and webkit browsers.



Debugging already done:


none



Possible fix:


not provided

Jamie Avins
5 Aug 2010, 8:21 AM
Excellent report, thanks.

revolt
6 Aug 2010, 7:58 AM
I'm experiencing this issue as well on a HTC Evo running Android 2.2.

JCullen
6 Aug 2010, 11:21 AM
Was having the same issue on a Nexus One device running Android 2.2, tracked it down to /core/TouchEventManager.js in the handler for startTrack

Starting at line 90:


if (Ext.platform.isAndroidOS) {
if (!['input', 'select', 'textarea'].contains(target.tagName.toLowerCase())) {
e.preventDefault();
e.stopPropagation();
}
}

e.preventDefault(); seems to be blocking android from handling links, commenting it out allows them to work.
In ext-touch-debug.js this would be line 2925.

kostik83
9 Aug 2010, 12:04 PM
This is an issue on HTC ledgend runnign Android 2.1

suzzer99
26 Oct 2010, 4:26 PM
@JCullen your fix is the only thing I've found that solves the Droid anchor problem so far. Does anyone know what this line was supposed to do?

hello2008
17 Nov 2010, 8:15 AM
I happened to meet this issue today on AndroidOS 2.2 of HTC Desire. I'm using latest Sencha Touch version 1.0. My scenario is that all the links not working when click/tap, and all the onclick inline events no respond.
After long time tracing, I have to comment out these two lines in "src/core/Ext.js"


onTouchStartCapturing: function(e) {
var target = e.target;

if (!Ext.currentlyFocusedField && !Ext.is.Android) {
this.scrollToTop();
}

if (Ext.is.Android) {
if (target.nodeType == 3) {
target = target.parentNode;
}

if (target.tagName && (/input|select|textarea/i.test(target.tagName))) {
return;
}

//e.preventDefault(); // comment out here
//e.stopPropagation();
}
}