成人国产在线小视频_日韩寡妇人妻调教在线播放_色成人www永久在线观看_2018国产精品久久_亚洲欧美高清在线30p_亚洲少妇综合一区_黄色在线播放国产_亚洲另类技巧小说校园_国产主播xx日韩_a级毛片在线免费

資訊專欄INFORMATION COLUMN

The input element's type ('number')

CoderDock / 2292人閱讀

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)允許請勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。

轉(zhuǎn)載請注明本文地址:http://systransis.cn/yun/97397.html

相關(guān)文章

  • H5 input[type='date'] 優(yōu)化 pc端和移動端的使用

    標簽在HTML5中新增了color, date, datetime, datetime-local, month, week, time, email, number, range, search, tel 以及 url新屬性。本篇記錄在開發(fā)中使用date屬性,遇到的一些問題,以及功能擴展: 獲取當前日期,并顯示在input[type=date]上 html: js: $(function(...

    VincentFF 評論0 收藏0
  • H5 input[type='date'] 優(yōu)化 pc端和移動端的使用

    標簽在HTML5中新增了color, date, datetime, datetime-local, month, week, time, email, number, range, search, tel 以及 url新屬性。本篇記錄在開發(fā)中使用date屬性,遇到的一些問題,以及功能擴展: 獲取當前日期,并顯示在input[type=date]上 html: js: $(function(...

    wemallshop 評論0 收藏0
  • H5 input[type='date'] 優(yōu)化 pc端和移動端的使用

    標簽在HTML5中新增了color, date, datetime, datetime-local, month, week, time, email, number, range, search, tel 以及 url新屬性。本篇記錄在開發(fā)中使用date屬性,遇到的一些問題,以及功能擴展: 獲取當前日期,并顯示在input[type=date]上 html: js: $(function(...

    haoguo 評論0 收藏0
  • the deadline of JavaScript's this

    摘要:在用處千千萬,基于自己研究和認識,今天做一個了斷??梢匀∷鶎賹ο蟮纳舷挛牡姆椒ǚQ為公共方法,可以使屬性,方法變成公開的屬性方法在構(gòu)造函數(shù),方法中用到。內(nèi)部函數(shù)調(diào)用的時候,只能搜索到其活動對象為止,不可能直接訪問外部函數(shù)中的變量。 this this在JavaScript用處千千萬,基于自己研究和認識,今天做一個了斷。 全局,匿名函數(shù)調(diào)用 對象方法調(diào)用 閉包總指向上一級 構(gòu)造函數(shù)中,指...

    chinafgj 評論0 收藏0

發(fā)表評論

0條評論

最新活動
閱讀需要支付1元查看
<