Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
371 views
in Technique[技术] by (71.8m points)

Ionic在安卓版微信上遇到的问题(select很难选中)

ionic1.2.4版本在安卓版微信上,select标签很难点中,之前看到有人通过升级ionic版本至1.3.2解决了这个问题,但是由于目前app已经在生产环境中运行,担心升级ionic版本后会带来其他问题,有什么好的解决办法吗?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

在不升级到最新版Ionic的情况下,可以通过修改ionic.bundle.js中的代码解决这个问题

function tapIgnoreEvent(e) {

  if (e.isTapHandled) return true;
  e.isTapHandled = true;

  if(ionic.tap.isElementTapDisabled(e.target)) {
    return true;
  }
  //添加下面这两行代码
  if(e.target.tagName == 'SELECT') {
    return true;
  }
  
  if (ionic.scroll.isScrolling && ionic.tap.containsOrIsTextInput(e.target)) {
    e.preventDefault();
    return true;
  }
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...