taro-ui icon indicating copy to clipboard operation
taro-ui copied to clipboard

Update index.tsx

Open panyu97py opened this issue 4 years ago • 4 comments

focus 为 false 且 clear 为 true 时 input 输入会使 input 失去焦点。

具体的表现为 clear 为 true 当输入第一个字符时 input失去焦点。focus为null 时则没有这种情况

panyu97py avatar Jun 28 '21 07:06 panyu97py

因为 focus 默认为 false , clear为true onInput 改变value的值后组件重新渲染后 focus 即为 false input失去焦点,同样的情况也会出现在 error 的值改变后

          <Input focus={false} />
          {clear && value && (
            <View className='at-input__icon' onTouchEnd={this.handleClearValue}>
              <Text className='at-icon at-icon-close-circle at-input__icon-close'></Text>
            </View>
          )}
          {error && (
            <View
              className='at-input__icon'
              onTouchStart={this.handleErrorClick}
            >
              <Text className='at-icon at-icon-alert-circle at-input__icon-alert'></Text>
            </View>
          )}

panyu97py avatar Jun 28 '21 08:06 panyu97py

fix #1199

panyu97py avatar Jun 29 '21 01:06 panyu97py

我也遇到了,可怜

hjhwel avatar Oct 14 '21 09:10 hjhwel

focus focus 传个 null 或者参考 我的 pr 直接改源码

panyu97py avatar Dec 06 '21 12:12 panyu97py

@panyu97py 感谢反馈,该问题已解决 #1463,将在近期发布,故只能关闭该 PR,感谢你对项目的贡献,欢迎继续贡献~

robinv8 avatar May 02 '23 14:05 robinv8