jd-opensource / jd-opensource/taro-ui
Taro AtForm重构代码导致onSubmit和onReset事件参数有误
- Dominant language
- TypeScript
- Stars
- 4.7k
- Forks
- 740
- PR merge metrics
- No merged PRs in 30d
Description
### Taro UI 版本信息
v2.3.4
### 问题描述
commit记录地址[https://github.com/NervJS/taro-ui/commit/54e1d47541d582d5e951485458cfcbaeb42ed494](https://github.com/NervJS/taro-ui/commit/54e1d47541d582d5e951485458cfcbaeb42ed494)
删除后的第9行更改为第13行代码后,由于arguments作为数组直接向onSubmit和onReset进行发送,导致事件接收到的数据为数组
### 复现步骤
1. 创建一个form表单
2. 点击form表单提交
3. 参数event为数组
### 复现代码
```
import { AtButton, AtForm } from 'taro-ui';
import { View } from '@tarojs/components';
import { CommonEvent } from '@tarojs/components/types/common';
import Taro, { Component } from '@tarojs/taro';
class DemoForm extends Component {
private handleSubmit = (e: CommonEvent) => {
console.log(e);
}
render () {
return (
Submit
);
}
}
export default DemoForm;
```
### 报错信息
```
e.stopPropagation is not a function
```
### 系统信息
Taro 2.x
### 补充信息
原因详见问题描述.
使用者可临时回退到commit前的taro-ui版本解决问题,或变更`dist\weapp\components\form\index.tsx`
Contributor guide
Assessment
This issue has not been assessed yet.