We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Button.js中的代码:
Button.js
if ( !me.isDisabled() ) { me.onclick(); }
onclick事件不能通过return false来阻止默认行为,如果是一个submit按钮,那么点击后表单仍会提交。
onclick
return false
submit
另外,css里在disabled状态下按钮上鼠标仍是手型。
disabled
The text was updated successfully, but these errors were encountered:
fixed
Sorry, something went wrong.
没有彻底修复,不过应该是另一个问题,但应该合并考虑。
原因是Button设置禁用时并没有吧主元素main设置HTML的原生禁用状态,导致表单仍然会提交。
两种修复方案:
在现有基础上先不考虑真实禁用状态(但迟早是问题),对判断禁用后采取同样的措施preventDefault;
if ( me.isDisabled() || false === me.onclick() ) { baidu.event.preventDefault(e || window.event); }
解决掉禁用状态,使之彻底不可点;
各位考虑。
leeight
No branches or pull requests
Button.js
中的代码:onclick
事件不能通过return false
来阻止默认行为,如果是一个submit
按钮,那么点击后表单仍会提交。另外,css里在
disabled
状态下按钮上鼠标仍是手型。The text was updated successfully, but these errors were encountered: