fastclick.js?bf9a:331 Uncaught DOMException: Failed to execute "setSelectionRange" on "HTMLInputElement": The input element"s type ("number") does not support selection
解決方法:
找到node_module中的文件fastclick.js, line: 327 將
if (deviceIsIOS && targetElement.setSelectionRange && targetElement.type.indexOf("date") !== 0 && targetElement.type !== "time" && targetElement.type !== "month") { length = targetElement.value.length; targetElement.setSelectionRange(length, length); } else { targetElement.focus(); }
替換為:
var useSelectionRange = deviceIsIOS; if(useSelectionRange){ try{ length = targetElement.value.length; targetElement.setSelectionRange(length, length); }catch(error){ useSelectionRange = false; } } if (!useSelectionRange) { targetElement.focus(); }
文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請(qǐng)注明本文地址:http://www.ezyhdfw.cn/yun/97397.html
標(biāo)簽在HTML5中新增了color, date, datetime, datetime-local, month, week, time, email, number, range, search, tel 以及 url新屬性。本篇記錄在開發(fā)中使用date屬性,遇到的一些問題,以及功能擴(kuò)展: 獲取當(dāng)前日期,并顯示在input[type=date]上 html: js: $(function(...
標(biāo)簽在HTML5中新增了color, date, datetime, datetime-local, month, week, time, email, number, range, search, tel 以及 url新屬性。本篇記錄在開發(fā)中使用date屬性,遇到的一些問題,以及功能擴(kuò)展: 獲取當(dāng)前日期,并顯示在input[type=date]上 html: js: $(function(...
標(biāo)簽在HTML5中新增了color, date, datetime, datetime-local, month, week, time, email, number, range, search, tel 以及 url新屬性。本篇記錄在開發(fā)中使用date屬性,遇到的一些問題,以及功能擴(kuò)展: 獲取當(dāng)前日期,并顯示在input[type=date]上 html: js: $(function(...
摘要:在用處千千萬,基于自己研究和認(rèn)識(shí),今天做一個(gè)了斷??梢匀∷鶎賹?duì)象的上下文的方法稱為公共方法,可以使屬性,方法變成公開的屬性方法在構(gòu)造函數(shù),方法中用到。內(nèi)部函數(shù)調(diào)用的時(shí)候,只能搜索到其活動(dòng)對(duì)象為止,不可能直接訪問外部函數(shù)中的變量。 this this在JavaScript用處千千萬,基于自己研究和認(rèn)識(shí),今天做一個(gè)了斷。 全局,匿名函數(shù)調(diào)用 對(duì)象方法調(diào)用 閉包總指向上一級(jí) 構(gòu)造函數(shù)中,指...
閱讀 642·2021-11-15 11:38
閱讀 1361·2021-10-11 10:59
閱讀 3555·2021-09-07 09:58
閱讀 547·2019-08-30 15:44
閱讀 3580·2019-08-28 18:14
閱讀 2662·2019-08-26 13:32
閱讀 3570·2019-08-26 12:23
閱讀 2472·2019-08-26 10:59