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

fix(form): submit behavior & reset param #964

Merged
merged 3 commits into from
Jun 12, 2022

Conversation

k1nz
Copy link
Contributor

@k1nz k1nz commented Jun 9, 2022

🤔 这个 PR 的性质是?

  • 日常 bug 修复
  • 新特性提交
  • 文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • CI/CD 改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他

🔗 相关 Issue

#899
#868

💡 需求背景和解决方案

(#868) 原先的实例方法 submit 调用的是原生的 form.submit(),但这个方法并不会触发 submit 事件,导致 preventDefault 无法阻止页面刷新,现在改用 HTMLFormElement.requestSubmit() ,该方法行为和 <button type="submit" /> 行为一致。

(#899) 回滚的时候估计没有注意到 reset 方法的参数,现在又补上了

📝 更新日志

  • fix(Form): 修复调用实例方法 reset 添加参数无效
  • fix(Form): 修复调用实例方法 submitonSubmit 回调函数参数 eundefined 的问题

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供

@github-actions
Copy link
Contributor

github-actions bot commented Jun 9, 2022

完成

@PengYYYYY
Copy link
Collaborator

PengYYYYY commented Jun 10, 2022

更新一下本地依赖,然后推上来

@k1nz
Copy link
Contributor Author

k1nz commented Jun 10, 2022

更新一下本地依赖,然后推上来

是最新的

@PengYYYYY PengYYYYY merged commit c95905b into Tencent:develop Jun 12, 2022
@k1nz k1nz deleted the fix/form/instance_function branch June 12, 2022 07:25
@github-actions github-actions bot mentioned this pull request Jun 13, 2022
4 tasks
@vabora
Copy link

vabora commented Jun 17, 2022

@PengYYYYY safari 浏览器貌似不支持HTMLFormElement.requestSubmit()吧,0.16.0版本。用form实例提交报错。

@k1nz k1nz mentioned this pull request Jun 17, 2022
16 tasks
@k1nz
Copy link
Contributor Author

k1nz commented Jun 17, 2022

@PengYYYYY safari 浏览器貌似不支持HTMLFormElement.requestSubmit()吧,0.16.0版本。用form实例提交报错。

@vabora #998 在这里解决了

@github-actions github-actions bot mentioned this pull request Jun 20, 2022
15 tasks
@whitePythonLearn
Copy link

实例方法怎么调用的?给个示例嘛

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants