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

编辑器存在 form 中,情景菜单会出发提交事件 #575

Closed
ihewro opened this issue Jul 12, 2020 · 1 comment
Closed

编辑器存在 form 中,情景菜单会出发提交事件 #575

ihewro opened this issue Jul 12, 2020 · 1 comment
Assignees
Milestone

Comments

@ihewro
Copy link

ihewro commented Jul 12, 2020

请先看《提问的智慧》,并尝试到黑客派搜寻资料解决问题。


编辑模式

所见即所得模式

描述问题

我将编辑器集成我的项目中之后,点击页面中的删除,位置调整之类的按钮,页面会跳转到首页,

在button 标签中增加了type="button" 之类就正常了

image

期待的结果

页面不跳转

@ihewro
Copy link
Author

ihewro commented Jul 12, 2020

通过js 也解决了问题~

        $("#vditor").on("click","button",function(e){
            e.preventDefault();
            e.stopPropagation();

        });

@ihewro ihewro closed this as completed Jul 12, 2020
@Vanessa219 Vanessa219 self-assigned this Jul 12, 2020
@Vanessa219 Vanessa219 reopened this Jul 12, 2020
@Vanessa219 Vanessa219 added this to the 3.3 milestone Jul 12, 2020
@Vanessa219 Vanessa219 changed the title 编辑器内部的button 是否可以增加type="button"属性 编辑器存在 form 中,情景菜单会出发提交事件 Jul 12, 2020
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