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(data-template): fix title input prevented proper data switching #1937

Merged
merged 3 commits into from
May 26, 2023

Conversation

zhangzhonghe
Copy link
Contributor

@zhangzhonghe zhangzhonghe commented May 26, 2023

Description (Bug 描述)

如下图所示,如果先输入 模板标题 会导致其它选项异常。

img_v2_f03814af-6a79-426d-88d8-00a6c5c85e4g

Steps to reproduce (复现步骤)

  1. 打开设置数据模板弹窗
  2. 先输入 模板标题
  3. 再切换 数据表
  4. 会发现 模板数据 还是保持原样,并没有跟着 数据表 切换

Expected behavior (预期行为)

  • 无论是否是先输入 模板标题 都不影响其它选项的正常使用

Actual behavior (实际行为)

  • 参考上面的 复现步骤

Related issues (相关 issue)

Reason (原因)

  • 在修改 模板标题 的时候破环了原有数据的响应性,导致数据变更之后 UI 没有刷新

Solution (解决方案)

  • DataTemplateTitle 组件中修改 onChangeonBlur 的监听方法,防止破环数据的响应性。

具体变动请看:https://github.com/nocobase/nocobase/pull/1937/files?diff=split&w=0

@zhangzhonghe zhangzhonghe marked this pull request as ready for review May 26, 2023 03:26
@zhangzhonghe zhangzhonghe merged commit fa778b3 into main May 26, 2023
4 checks passed
@zhangzhonghe zhangzhonghe deleted the zzh/fix-data-template branch May 26, 2023 04:08
aotemj pushed a commit to aotemj/nocobase that referenced this pull request May 29, 2023
…ocobase#1937)

* fix(data-template): fix title input prevented proper data switching

* fix: build error

* fix: clear the previous data before switching
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

1 participant