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

AtInput 的 props 没有穿透传递给 Input 组件 #1654

Closed
axetroy opened this issue Aug 21, 2023 · 1 comment
Closed

AtInput 的 props 没有穿透传递给 Input 组件 #1654

axetroy opened this issue Aug 21, 2023 · 1 comment
Assignees
Labels
bug Something isn't working fixed but not released 已修复但未发布

Comments

@axetroy
Copy link
Contributor

axetroy commented Aug 21, 2023

问题描述

AtInput 的 props 没有穿透传递给 Input 组件,导致有些属性是写了声明文件,但实际上并没有作用到内部的 Input

复现步骤

                    <AtInput
                        required
                        name='number'
                        type='text'
                        title={t('Password')}
                        value={tempPassword}
                        placeholder={t('Please enter your password')}
                        maxlength={4}
                        onChange={(value) => {
                            setTempPassword(value + '')
                        }}
+                        enableNative={false}
                    />

例如此处添加的 enableNative 是声明了,但源码里面没有用到

<Input
className='at-input__input'
{...id}
name={name}
type={type}
disabled={disabled}
password={password}
placeholderStyle={placeholderStyle}
placeholderClass={placeholderCls}
placeholder={placeholder}
cursorSpacing={cursorSpacing}
maxlength={maxLength}
autoFocus={autoFocus}
// TODO: 临时解决方案,等 Taro 更新后还原到 focus={focus}
{...(focus ? { focus } : {})}
value={value}
confirmType={confirmType}
cursor={cursor}
selectionStart={selectionStart}
selectionEnd={selectionEnd}
adjustPosition={adjustPosition}
onInput={this.handleInput}
onFocus={this.handleFocus}
onBlur={this.handleBlur}
onConfirm={this.handleConfirm}
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
// @ts-ignore
onKeyboardHeightChange={this.handleKeyboardHeightChange}
/>

期望行为
属性能正常赋值到 Input 组件,否则就不要这个声明

报错信息

系统信息

👽 Taro v3.6.13

Taro CLI 3.6.13 environment info:
System:
OS: Windows 10 10.0.19045
Binaries:
Node: 16.14.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
npm: 6.14.18 - C:\Program Files\nodejs\npm.CMD
npmPackages:
@tarojs/cli: 3.6.13 => 3.6.13
@tarojs/components: 3.6.13 => 3.6.13
@tarojs/helper: 3.6.13 => 3.6.13
@tarojs/plugin-framework-react: 3.6.13 => 3.6.13
@tarojs/plugin-platform-alipay: 3.6.13 => 3.6.13
@tarojs/plugin-platform-h5: 3.6.13 => 3.6.13
@tarojs/plugin-platform-jd: 3.6.13 => 3.6.13
@tarojs/plugin-platform-qq: 3.6.13 => 3.6.13
@tarojs/plugin-platform-swan: 3.6.13 => 3.6.13
@tarojs/plugin-platform-tt: 3.6.13 => 3.6.13
@tarojs/plugin-platform-weapp: 3.6.13 => 3.6.13
@tarojs/react: 3.6.13 => 3.6.13
@tarojs/runtime: 3.6.13 => 3.6.13
@tarojs/shared: 3.6.13 => 3.6.13
@tarojs/taro: 3.6.13 => 3.6.13
@tarojs/taro-h5: 3.6.13 => 3.6.13
@tarojs/taro-loader: 3.6.13 => 3.6.13
@tarojs/webpack5-runner: 3.6.13 => 3.6.13
babel-plugin-transform-taroapi: 3.6.13 => 3.6.13
babel-preset-taro: 3.6.13 => 3.6.13
eslint-config-taro: 3.6.13 => 3.6.13
react: ^18.2.0 => 18.2.0
taro-ui: ^3.1.0 => 3.1.0d

补充信息

@taro-ui-bot
Copy link

taro-ui-bot bot commented Aug 21, 2023

欢迎提交 Issue~

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

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

Good luck and happy coding~

@robinv8 robinv8 added the bug Something isn't working label Aug 21, 2023
@robinv8 robinv8 self-assigned this Aug 21, 2023
@robinv8 robinv8 added the fixed but not released 已修复但未发布 label Nov 9, 2023
robinv8 added a commit that referenced this issue Nov 17, 2023
New Features

- 添加 Timeline 获取节点信息事件 (#1650)
- List 组件支持自定义 icon 属性 (#1626)
- Card 组件 extra 属性支持 ReactNode (#1684)

Bug Fixes

- 修复 AtAccordion 组件展开高度错误的问题 (#1656)
- 修复 enableNative 属性不存在的问题 (#1654)

Improvements

- yarn 升级到 pnpm
- 完善 CI 流程
- 更新 Taro-UI 文档地址
robinv8 added a commit that referenced this issue Nov 19, 2023
New Features

- 添加 Timeline 获取节点信息事件 (#1650)
- List 组件支持自定义 icon 属性 (#1626)
- Card 组件 extra 属性支持 ReactNode (#1684)

Bug Fixes

- 修复 AtAccordion 组件展开高度错误的问题 (#1656)
- 修复 enableNative 属性不存在的问题 (#1654)
- 修复日历组件无法正常加载的问题

Improvements

- yarn 升级到 pnpm
- 完善 CI 流程
- 更新 Taro-UI 文档地址
@robinv8 robinv8 closed this as completed Nov 19, 2023
This was referenced Nov 19, 2023
robinv8 added a commit that referenced this issue Nov 20, 2023
New Features

- 添加 Timeline 获取节点信息事件 (#1650)
- List 组件支持自定义 icon 属性 (#1626)
- Card 组件 extra 属性支持 ReactNode (#1684)

Bug Fixes

- 修复 AtAccordion 组件展开高度错误的问题 (#1656)
- 修复 enableNative 属性不存在的问题 (#1654)
- 修复日历组件无法正常加载的问题

Improvements

- yarn 升级到 pnpm
- 完善 CI 流程
- 更新 Taro-UI 文档地址
robinv8 added a commit that referenced this issue Nov 20, 2023
New Features

- 添加 Timeline 获取节点信息事件 (#1650)
- List 组件支持自定义 icon 属性 (#1626)
- Card 组件 extra 属性支持 ReactNode (#1684)

Bug Fixes

- 修复 AtAccordion 组件展开高度错误的问题 (#1656)
- 修复 enableNative 属性不存在的问题 (#1654)
- 修复日历组件无法正常加载的问题

Improvements

- yarn 升级到 pnpm
- 完善 CI 流程
- 更新 Taro-UI 文档地址
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed but not released 已修复但未发布
Projects
None yet
Development

No branches or pull requests

2 participants