{"action":"created","issue":{"url":"https://api.github.com/repos/amazeui/amazeui-react/issues/42","labels_url":"https://api.github.com/repos/amazeui/amazeui-react/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/amazeui/amazeui-react/issues/42/comments","events_url":"https://api.github.com/repos/amazeui/amazeui-react/issues/42/events","html_url":"https://github.com/amazeui/amazeui-react/issues/42","id":105809537,"number":42,"title":"无法使用自定义按钮，关闭modal","user":{"login":"Pliman","id":3078105,"avatar_url":"https://avatars.githubusercontent.com/u/3078105?v=3","gravatar_id":"","url":"https://api.github.com/users/Pliman","html_url":"https://github.com/Pliman","followers_url":"https://api.github.com/users/Pliman/followers","following_url":"https://api.github.com/users/Pliman/following{/other_user}","gists_url":"https://api.github.com/users/Pliman/gists{/gist_id}","starred_url":"https://api.github.com/users/Pliman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pliman/subscriptions","organizations_url":"https://api.github.com/users/Pliman/orgs","repos_url":"https://api.github.com/users/Pliman/repos","events_url":"https://api.github.com/users/Pliman/events{/privacy}","received_events_url":"https://api.github.com/users/Pliman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-10T13:48:12Z","updated_at":"2015-09-11T03:44:42Z","closed_at":null,"body":"某些情况下，confirm的时候，不想关闭dialog，比如dialog中有内容，但是确定的时候，内容验证失败，需要重新填写，这个时候，不想关闭modal。本来想用onConfirm，return false；来禁止关闭modal结果不行，看了实现代码，从机制上没有提供次功能。\r\n\r\nModalTrigger.js L93\r\nonConfirm: createChainedFunction(this.close, this.props.onConfirm)\r\n表示点击确定的时候，先执行close，再执行this.props.onConfirm，无论onConfirm执行的执行的结果如何，close都会执行。(createChainedFunction.js L36)\r\n\r\n不能阻止modal关闭，少了此功能。\r\n一种可能的修改方式是：\r\n\r\nModalTrigger.js L93\r\nonConfirm: createChainedFunction(this.props.onConfirm, this.close)\r\n\r\ncreateChainedFunction.js L36\r\none.apply(this, arguments) === false || two.apply(this, arguments);\r\n去掉L37\r\n\r\nonCancel同理。"},"comment":{"url":"https://api.github.com/repos/amazeui/amazeui-react/issues/comments/139445484","html_url":"https://github.com/amazeui/amazeui-react/issues/42#issuecomment-139445484","issue_url":"https://api.github.com/repos/amazeui/amazeui-react/issues/42","id":139445484,"user":{"login":"Pliman","id":3078105,"avatar_url":"https://avatars.githubusercontent.com/u/3078105?v=3","gravatar_id":"","url":"https://api.github.com/users/Pliman","html_url":"https://github.com/Pliman","followers_url":"https://api.github.com/users/Pliman/followers","following_url":"https://api.github.com/users/Pliman/following{/other_user}","gists_url":"https://api.github.com/users/Pliman/gists{/gist_id}","starred_url":"https://api.github.com/users/Pliman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pliman/subscriptions","organizations_url":"https://api.github.com/users/Pliman/orgs","repos_url":"https://api.github.com/users/Pliman/repos","events_url":"https://api.github.com/users/Pliman/events{/privacy}","received_events_url":"https://api.github.com/users/Pliman/received_events","type":"User","site_admin":false},"created_at":"2015-09-11T03:44:42Z","updated_at":"2015-09-11T03:44:42Z","body":"现在是这样做的，但是感觉还是不太便。\r\n\r\n还是希望onConfirm，可以有能力阻止close，就像一般的form submit，如果onsubmit=\"return false;\"，表单就不提交。"}}