admin管理员组文章数量:1319482
I'm trying to use the touchend (or the taphold event, both wont fire) as specified by jquery mobile. I'm developping an app for android using the phonegap platform. My AVD runs Android 4.0.3, and my phonegap version is 1.3.0.
As im using phonegap, i'm coding in javascript, and the objective is to recuperate the text selected by the user after a longpress on a word with the following code.
var selectAction = function(){
LOGGER.log('event.js : selectAction');
};
function selectMobile(ponent){
ponent.addEventListener('touchend',selectAction,false);
}
It actually works fine, if I tap relatively quickly, the event will fire up and I can get the log message. However, a rapid touch will not select text (I have more code taking the selected text but this is not the issue)
When a user long presses in Android, a default ''Action Menu'' pops up, and this seems to block further events from firing up. Because of that, I never get into my selectAction when actual text is selected.
Does anybody know how to properly get selected text in an html/javascript on an Android platform ?
Thank you very much.
I'm trying to use the touchend (or the taphold event, both wont fire) as specified by jquery mobile. I'm developping an app for android using the phonegap platform. My AVD runs Android 4.0.3, and my phonegap version is 1.3.0.
As im using phonegap, i'm coding in javascript, and the objective is to recuperate the text selected by the user after a longpress on a word with the following code.
var selectAction = function(){
LOGGER.log('event.js : selectAction');
};
function selectMobile(ponent){
ponent.addEventListener('touchend',selectAction,false);
}
It actually works fine, if I tap relatively quickly, the event will fire up and I can get the log message. However, a rapid touch will not select text (I have more code taking the selected text but this is not the issue)
When a user long presses in Android, a default ''Action Menu'' pops up, and this seems to block further events from firing up. Because of that, I never get into my selectAction when actual text is selected.
Does anybody know how to properly get selected text in an html/javascript on an Android platform ?
Thank you very much.
Share Improve this question asked Feb 20, 2012 at 20:05 JulzJulz 1571 gold badge3 silver badges9 bronze badges1 Answer
Reset to default 7It's could be related to below bug. http://code.google./p/android/issues/detail?id=19827
try catch touchmove and call e.preventDefault()
本文标签: Javascript touchend event will not fire on AndroidStack Overflow
版权声明:本文标题:Javascript touchend event will not fire on Android - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742059799a2418512.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论