H5 Input solve a rubber band effect

// gets focus
 cancelScroll(e) {
        clearTimeout(this.timeoutTimer)
        clearTimeout(this.timeoutTimer01)
        if (utils.isAndroid ()) {
            this.timeoutTimer01 = setTimeout(() => {
                e.target.scrollIntoViewIfNeeded()
            }, 800)
        }
    },
    // input box blur out of focus
    scrollTopFn() {
        clearTimeout(this.timeoutTimer)
        clearTimeout(this.timeoutTimer01)
        this.timeoutTimer = setTimeout(() => {
            window.scroll(0, 0)
        }, 300)
    },

Guess you like

Origin www.cnblogs.com/zhanghongb/p/12521924.html