{"action":"created","issue":{"url":"https://api.github.com/repos/NervJS/taro/issues/1819","repository_url":"https://api.github.com/repos/NervJS/taro","labels_url":"https://api.github.com/repos/NervJS/taro/issues/1819/labels{/name}","comments_url":"https://api.github.com/repos/NervJS/taro/issues/1819/comments","events_url":"https://api.github.com/repos/NervJS/taro/issues/1819/events","html_url":"https://github.com/NervJS/taro/issues/1819","id":396130484,"node_id":"MDU6SXNzdWUzOTYxMzA0ODQ=","number":1819,"title":"Taro1.2.4版H5端Input组件问题","user":{"login":"schinvendy","id":17189558,"node_id":"MDQ6VXNlcjE3MTg5NTU4","avatar_url":"https://avatars0.githubusercontent.com/u/17189558?v=4","gravatar_id":"","url":"https://api.github.com/users/schinvendy","html_url":"https://github.com/schinvendy","followers_url":"https://api.github.com/users/schinvendy/followers","following_url":"https://api.github.com/users/schinvendy/following{/other_user}","gists_url":"https://api.github.com/users/schinvendy/gists{/gist_id}","starred_url":"https://api.github.com/users/schinvendy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schinvendy/subscriptions","organizations_url":"https://api.github.com/users/schinvendy/orgs","repos_url":"https://api.github.com/users/schinvendy/repos","events_url":"https://api.github.com/users/schinvendy/events{/privacy}","received_events_url":"https://api.github.com/users/schinvendy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-01-05T03:54:25Z","updated_at":"2019-01-05T03:54:27Z","closed_at":null,"author_association":"NONE","body":"**问题描述**\r\n在Taro 1.2.3版本下没有出现，升级1.2.4后，Input组件类型为number或者digit时输入就会出现报错。\r\n\r\n> Uncaught DOMException: Failed to set the 'selectionStart' property on 'HTMLInputElement': The input element's type ('number') does not support selection.\r\n\r\n**复现步骤**\r\n\r\n测试Demo\r\n\r\n```js\r\nimport Taro, { Component } from '@tarojs/taro';\r\nimport { View, Input, Text } from '@tarojs/components';\r\nimport './index.scss';\r\n\r\nexport default class Index extends Component {\r\n  config = {\r\n    navigationBarTitleText: '首页'\r\n  };\r\n\r\n  state = {\r\n    text: 'text',\r\n    number: 1,\r\n    digit: 2.2\r\n  };\r\n\r\n  componentDidMount() {}\r\n\r\n  onInput(type, e) {\r\n    console.log('[type]', type, ', [e detail value]', e.detail.value);\r\n    this.setState({\r\n      [type]: e.detail.value\r\n    });\r\n  }\r\n\r\n  render() {\r\n    return (\r\n      <View className=\"index\">\r\n        <Text>获取输入值:{this.state.text}</Text>\r\n        <Input type=\"text\" placeholder=\"输入同步到 view 中\" onInput={this.onInput.bind(this, 'text')} />\r\n        <Text>数字输入的 input:{this.state.number}</Text>\r\n        <Input type=\"number\" placeholder=\"这是一个数字输入框\" onInput={this.onInput.bind(this, 'number')} />\r\n        <Text>带小数点的 input:{this.state.digit}</Text>\r\n        <Input type=\"digit\" placeholder=\"带小数点的数字键盘\" onInput={this.onInput.bind(this, 'digit')} />\r\n      </View>\r\n    );\r\n  }\r\n}\r\n```\r\n\r\n**报错信息**\r\n\r\nTaro v1.2.3 版本下:\r\n![1 2 3ver](https://user-images.githubusercontent.com/17189558/50720022-4520b180-10e0-11e9-9982-183d97649b30.gif)\r\n\r\nTaro v1.2.4 版本下:\r\n![1 2 4ver](https://user-images.githubusercontent.com/17189558/50720025-4baf2900-10e0-11e9-9da7-8e965d91d67d.gif)\r\n\r\n\r\n**系统信息**\r\n出现报错的环境：\r\n> 👽 Taro v1.2.4\r\n  Taro CLI 1.2.4 environment info:\r\n    System:\r\n      OS: Windows 10\r\n    Binaries:\r\n      Node: 10.13.0 - D:\\nodejs\\node.EXE\r\n      npm: 6.4.1 - D:\\nodejs\\npm.CMD\r\n"},"comment":{"url":"https://api.github.com/repos/NervJS/taro/issues/comments/451625177","html_url":"https://github.com/NervJS/taro/issues/1819#issuecomment-451625177","issue_url":"https://api.github.com/repos/NervJS/taro/issues/1819","id":451625177,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MTYyNTE3Nw==","user":{"login":"taro-bot[bot]","id":44693195,"node_id":"MDM6Qm90NDQ2OTMxOTU=","avatar_url":"https://avatars3.githubusercontent.com/in/20114?v=4","gravatar_id":"","url":"https://api.github.com/users/taro-bot%5Bbot%5D","html_url":"https://github.com/apps/taro-bot","followers_url":"https://api.github.com/users/taro-bot%5Bbot%5D/followers","following_url":"https://api.github.com/users/taro-bot%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/taro-bot%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/taro-bot%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taro-bot%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/taro-bot%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/taro-bot%5Bbot%5D/repos","events_url":"https://api.github.com/users/taro-bot%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/taro-bot%5Bbot%5D/received_events","type":"Bot","site_admin":false},"created_at":"2019-01-05T03:54:27Z","updated_at":"2019-01-05T03:54:27Z","author_association":"NONE","body":"欢迎提交 Issue~\n\n如果你提交的是 bug 报告，请务必遵循 [Issue 模板](https://github.com/NervJS/taro/blob/master/.github/ISSUE_TEMPLATE/bug_report.md)的规范，尽量用简洁的语言描述你的问题，最好能提供一个稳定简单的复现。🙏🙏🙏\n\n如果你的信息提供过于模糊或不足，或者已经其他 issue 已经存在相关内容，你的 issue 有可能会被关闭。\n\nGood luck and happy coding~"}}
{"actor":{"display_login":"taro-bot"}}