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

回车后表单提交事件不执行 #11635

Open
738326776zby opened this issue Feb 19, 2025 · 6 comments
Open

回车后表单提交事件不执行 #11635

738326776zby opened this issue Feb 19, 2025 · 6 comments

Comments

@738326776zby
Copy link

描述问题:

Form 表单设置了回车提交,回车input 不会执行表单提交,点击提交按钮会执行

截图或视频:

Image

如何复现(请务必完整填写下面内容):

  1. 你是如何使用 amis 的?
    sdknpm其他...

npm

  1. amis 版本是什么?请先在最新 beta 版本测试问题是否存在
    "amis": "6.11.0",
    "amis-core": "6.11.0",
    "amis-editor": "6.11.0",
    "amis-editor-core": "6.11.0",
    "amis-formula": "6.11.0",
    "amis-widget": "^3.2.2",

  2. 粘贴有问题的完整 amis schema 代码:
    {
    "type": "form",
    "id": "u:4cb7093c2e45",
    "title": "表单",
    "mode": "flex",
    "labelAlign": "top",
    "dsType": "api",
    "feat": "Insert",
    "body": [
    {
    "type": "input-text",
    "label": "文本",
    "name": "text",
    "row": 0,
    "id": "u:262ed3ccab80"
    }
    ],
    "actions": [
    {
    "type": "button",
    "label": "提交",
    "onEvent": {
    "click": {
    "actions": [
    {
    "actionType": "submit",
    "componentId": "u:4cb7093c2e45"
    }
    ]
    }
    },
    "level": "primary",
    "id": "u:d0e556616013"
    }
    ],
    "resetAfterSubmit": true,
    "onEvent": {
    "submit": {
    "weight": 0,
    "actions": [
    {
    "ignoreError": false,
    "actionType": "custom",
    "script": "alert(1)",
    "args": {}
    }
    ]
    }
    }
    }

  3. 操作步骤
    请简单描述一下复现的操作步骤...

Copy link

👍 Thanks for this!
🏷 I have applied any labels matching special text in your issue.

Please review the labels and make any necessary changes.

@github-actions github-actions bot added the feat label Feb 19, 2025
@738326776zby
Copy link
Author

@2betop 老师可以帮我看一下嘛

@jinmingpang
Copy link
Contributor

看了下这个 json, 拷贝到文档官网是可以正常工作的,回车可以触发提交事件的。 这个可能是在编辑器有点问题~

@738326776zby
Copy link
Author

看了下这个 json, 拷贝到文档官网是可以正常工作的,回车可以触发提交事件的。 这个可能是在编辑器有点问题~

是的这个是编辑器的问题,可以修复一下吗

@jinmingpang
Copy link
Contributor

你编辑的json,得在页面上渲染使用啊,编辑器上又不能正常使用。如果在页面上能使用,这个就不算啥问题。

@738326776zby
Copy link
Author

你编辑的json,得在页面上渲染使用啊,编辑器上又不能正常使用。如果在页面上能使用,这个就不算啥问题。

编辑的时候想预览一下,预览的时候的问题,不过我把预览改成 renderAmis 渲染了,这个问题也解决了,先提给官方,有时间就解决下,没时间的话也没事,本身小问题

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

No branches or pull requests

2 participants