起步软件技术论坛
搜索
 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 7447|回复: 6

[分享] 部分IOS版本中点击input框无反应问题

  [复制链接]

998

主题

4330

帖子

1万

积分

论坛元老

Rank: 8Rank: 8

积分
10726
QQ
发表于 2019-7-11 14:21:34 | 显示全部楼层 |阅读模式
1、IOS11.3 fastclick.js bug导致的,修改/UI2/system/components/justep/lib/fastclick.js文件
2、320行左右,添加代码: targetElement.focus();  添加后的代码
  1. /**
  2. * @param {EventTarget|Element} targetElement
  3. */
  4. FastClick.prototype.focus = function(targetElement) {
  5.         'use strict';
  6.         var length;
  7.         // Issue #160: on iOS 7, some input elements (e.g. date datetime) throw a vague TypeError on setSelectionRange. These elements don't have an integer value for the selectionStart and selectionEnd properties, but unfortunately that can't be used for detection because accessing the properties also throws a TypeError. Just check the type instead. Filed as Apple bug #15122724.
  8.         if (deviceIsIOS && targetElement.setSelectionRange && targetElement.type.indexOf('date') !== 0 && targetElement.type !== 'number' && targetElement.type !== 'time' && targetElement.type !== 'month' && targetElement.type !== 'range') {
  9.                 length = targetElement.value.length;
  10.                 targetElement.setSelectionRange(length, length);
  11.                
  12.                 //wjw:2019-07-11,add
  13.                 /*修复bug ios 11.3不弹出键盘,这里加上聚焦代码,让其强制聚焦弹出键盘*/
  14.         targetElement.focus();
  15.         } else {
  16.                 targetElement.focus();
  17.         }
  18. };
复制代码



孤舟蓑笠翁,独钓寒江雪。
X5牛刀交流民间第一群:30057529
提供有偿服务,联系WX:18332024
bex5疑难问题解决方案

4

主题

13

帖子

156

积分

初级会员

Rank: 2

积分
156
QQ
发表于 2019-9-4 14:20:11 | 显示全部楼层
老哥,这样浏览器解决了,但打包后还是有问题啊...
回复 支持 反对

使用道具 举报

107

主题

385

帖子

1048

积分

金牌会员

Rank: 6Rank: 6

积分
1048
QQ
发表于 2019-9-4 14:35:08 | 显示全部楼层
谢谢分享,亲测可用,完美解决困扰了2年的问题。
回复 支持 反对

使用道具 举报

998

主题

4330

帖子

1万

积分

论坛元老

Rank: 8Rank: 8

积分
10726
QQ
 楼主| 发表于 2019-9-4 15:41:31 | 显示全部楼层
liupeng9030 发表于 2019-9-4 14:35
谢谢分享,亲测可用,完美解决困扰了2年的问题。

孤舟蓑笠翁,独钓寒江雪。
X5牛刀交流民间第一群:30057529
提供有偿服务,联系WX:18332024
bex5疑难问题解决方案
回复 支持 反对

使用道具 举报

22

主题

598

帖子

2109

积分

金牌会员

Rank: 6Rank: 6

积分
2109
QQ
发表于 2019-9-4 23:53:08 | 显示全部楼层
收藏,支持.............
【接活】APP 公众号 小程序 前后端带管理系统全套搞定
联系QQ:646105064 剑客共享  
欢迎用x5开发的朋友进群探讨!WeX5/BeX5民间一群:30057529  二群:211206160
回复

使用道具 举报

33

主题

140

帖子

869

积分

高级会员

Rank: 4

积分
869
QQ
发表于 2022-8-16 19:31:11 | 显示全部楼层
谢谢,使用这个方法解决我们系统大bug了
回复 支持 反对

使用道具 举报

33

主题

373

帖子

916

积分

高级会员

Rank: 4

积分
916
QQ
发表于 2022-12-16 11:31:44 | 显示全部楼层
学习了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|X3技术论坛|Justep Inc.    

GMT+8, 2024-4-26 14:50 , Processed in 0.086321 second(s), 23 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表