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: using a third-party form library causes "Uncaught TypeError: e.preventDefault is not a function" #1790

Closed
darkadept opened this issue Jun 23, 2017 · 0 comments · Fixed by #1788

Comments

@darkadept
Copy link

Using React Formal (https://github.com/jquense/react-formal) library and Semantic UI React together causes an error on form submission.

(This bug has been fixed in a PR, see bottom of this post)

Steps

I use the two library together like this:

import {default as Formal} from 'react-formal'; //They both have a component called <Form>
import {Form, Button} from 'semantic-ui-react';

class Thing extends Component {
  handleSubmit = (data) => {
  }

  render() {
    return {
      <Form
        as={Formal}
        schema={mySchema}
        onSubmit={this.handleSubmit}
      >
        // fields here...
        <button type="submit">Submit</button>
      </Form>
    }
  }
}

When I click on the button to submit the form it gives an error.

Expected Result

The form should be submitted.

Actual Result

I receive the following error on the console:

Uncaught TypeError: e.preventDefault is not a function

Version

Semantic UI React 0.69.0

A PR (#1788) has already been submitted that fixes this problem. A comment there requested an issue for a line comment. This is the issue.

@layershifter layershifter changed the title Using a third-party form library causes "Uncaught TypeError: e.preventDefault is not a function" Form: using a third-party form library causes "Uncaught TypeError: e.preventDefault is not a function" Jun 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant