Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复 当 input 类型为 range 时,FastClick 的相关错误 #995

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

Conversation

EthianWong
Copy link

当输入框(input)类型为范围选择器(range)时,执行 fastclick 将导致以下错误

Failed to read the 'setSelectionRange' property from 'HTMLInputElement': The input element's type ('range')

查阅以前的 issue 发现出现过类似问题,只不过并未处理范围选择器,只是处理了number与email的类型 (dad2b32)

根据 https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange 的指引,范围选择器(range) 不支持 setSelectionRange 方法。

目前修复方法是把 范围选择器(range) 加入到 FastClick.prototype.focus 的不支持的类型(unsupportedType)中去

Failed to read the 'setSelectionRange' property from 'HTMLInputElement': The input element's type ('range')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant