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

At input 禁用在Ios不生效

Open LlanHao opened this issue 2 years ago • 6 comments

问题描述 微信小程序,Taro UI 使用 Atinput 组件设置 editable 后在iOS真机依旧可以编辑,在微信开发者工具是不可以编辑的。

复现步骤

  1. 页面内引用 import {AtInput, AtForm} from 'taro-ui'
  2. 调用 <AtInput editable={false} placeholder='企业名称' value={this.state.xxx}/>
<AtForm>
     <Text className="input-icon">*</Text><Text className="company-name">企业名称</Text>
     <AtInput editable={false} placeholder='企业名称' value={this.state.financeApply.enterpriseName}/>
 </AtForm>

期望行为 input 禁用,并且置灰 image

系统信息 👽 Taro v3.3.9

Taro CLI 3.3.9 environment info: System: OS: macOS 12.1 Shell: 5.8 - /bin/zsh Binaries: Node: 14.17.1 - /usr/local/bin/node Yarn: 1.22.10 - /usr/local/bin/yarn npm: 8.5.1 - /usr/local/bin/npm npmPackages: @tarojs/components: 3.2.9 => 3.2.9 @tarojs/mini-runner: 3.2.9 => 3.2.9 @tarojs/react: 3.2.9 => 3.2.9 @tarojs/runtime: 3.2.9 => 3.2.9 @tarojs/taro: 3.2.9 => 3.2.9 @tarojs/webpack-runner: 3.2.9 => 3.2.9 babel-preset-taro: 3.2.9 => 3.2.9 eslint-config-taro: 3.2.9 => 3.2.9 react: ^17.0.0 => 17.0.2 taro-ui: ^3.0.0-alpha.10 => 3.0.0-alpha.10 npmGlobalPackages: typescript: 4.3.5

异常平台 [weapp] 微信小程序 iOS 真机

LlanHao avatar Apr 21 '22 07:04 LlanHao

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

taro-ui-bot[bot] avatar Apr 21 '22 07:04 taro-ui-bot[bot]

同问,这什么bug啊。突然就有了

tiancaizs avatar May 17 '22 06:05 tiancaizs

是因为taroui 的input 没有传disabled,我之前修了下,就是直接改包里的input

hjhwel avatar Jun 10 '22 03:06 hjhwel

同问,这什么bug啊。突然就有了

看记录是修复了,https://github.com/NervJS/taro-ui/pull/1471

LlanHao avatar Jul 06 '22 02:07 LlanHao

是因为taroui 的input 没有传disabled,我之前修了下,就是直接改包里的input

能提供下改了那个node包吗

LlanHao avatar Jul 06 '22 02:07 LlanHao

我是放在公司git 上了,就修改了这个disabled 和 输入框启用clear 后聚焦失效的AtInput.defaultProps = { className: '', customStyle: '', value: '', name: '', placeholder: '', placeholderStyle: '', placeholderClass: '', title: '', cursorSpacing: 50, confirmType: 'done', cursor: 0, selectionStart: -1, selectionEnd: -1, adjustPosition: true, maxlength: 140, type: 'text', disabled: false, border: true, editable: true, error: false, clear: false, autoFocus: false, focus: null,//从false 改成null required: false, // eslint-disable-next-line @typescript-eslint/no-empty-function onChange: function () { } };

hjhwel avatar Jul 06 '22 03:07 hjhwel

https://github.com/NervJS/taro-ui/blob/next/packages/taro-ui/src/components/input/index.tsx#L170

应该修复了

shinken008 avatar Sep 29 '22 02:09 shinken008