mirror of
https://github.com/vale981/accounts-ui
synced 2025-03-04 17:31:41 -05:00
Fixed the bug with autosubmitted form causing reloads.
This commit is contained in:
parent
9ecdd04f93
commit
19e3fcaa8f
1 changed files with 4 additions and 4 deletions
|
@ -9,9 +9,9 @@ import './SocialButtons.jsx';
|
|||
|
||||
export class Form extends React.Component {
|
||||
componentDidMount() {
|
||||
let node = ReactDOM.findDOMNode(this);
|
||||
if (node) {
|
||||
node.addEventListener('submit', (e) => {
|
||||
let form = this.form;
|
||||
if (form) {
|
||||
form.addEventListener('submit', (e) => {
|
||||
e.preventDefault();
|
||||
});
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ export class Form extends React.Component {
|
|||
className
|
||||
} = this.props;
|
||||
return (
|
||||
<form className={[className, ready ? "ready" : null].join(' ')} className="accounts-ui">
|
||||
<form ref={(ref) => this.form = ref} className={[className, ready ? "ready" : null].join(' ')} className="accounts-ui">
|
||||
<Accounts.ui.Fields fields={ fields } />
|
||||
<Accounts.ui.Buttons buttons={ buttons } />
|
||||
<Accounts.ui.PasswordOrService oauthServices={ oauthServices } />
|
||||
|
|
Loading…
Add table
Reference in a new issue