jd-opensource / jd-opensource/taro-ui

AtInput 组件在 android 下获得焦点位置不正确

Open
#871 2 comments 0 reactions 0 assignees View on GitHub
stale
Dominant language
TypeScript
Stars
4.7k
Forks
740
PR merge metrics
No merged PRs in 30d

Description

### Taro UI 版本信息

2.2.4

### 问题描述

AtInput 组件在 android 下获得焦点位置不正确,每次重新获得焦点后,焦点位置在输入框所有内容之前

### 复现步骤

1. android 系统
2. 支付宝小程序
3. 任意 type="text" 的输入框

### 复现代码

import Taro from '@tarojs/taro'
import { AtInput } from 'taro-ui'
export default class Index extends Taro.Component {
constructor () {
super(...arguments)
this.state = {
value: ''
}
}
handleChange (value) {
this.setState({
value
})
// 在小程序中,如果想改变 value 的值,需要 `return value` 从而改变输入框的当前值
return value
}
render () {
return (

)
}

### 报错信息

焦点位置错误

### 系统信息

1. taro 1.3.25
2. taro-ui 2.2.4

### 补充信息

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.