Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.

feat: Allow to use html form attributes#77

Merged
diego3g merged 3 commits into
unform:masterfrom
danilomartinelli:feature/allow-html-form-attributes
Jun 11, 2019
Merged

feat: Allow to use html form attributes#77
diego3g merged 3 commits into
unform:masterfrom
danilomartinelli:feature/allow-html-form-attributes

Conversation

@danilomartinelli

@danilomartinelli danilomartinelli commented May 24, 2019

Copy link
Copy Markdown
Contributor

Changes proposed

We are not currently able to use some html events such as onBlur, onFocus and we can't pass props to use custom class and styles. This PR allows to pass HTML Form Attributes as props to Form component.

Additional context

I added a type Omit in types.ts to exclude onSubmit in FormHTMLAttributes because type of property 'onSubmit' is incompatible with onSubmit: (data: object, helpers: Helpers) => void.

export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;

I needed to create a .prettierrc file with singleQuote rule to force use single quote on save.

@diego3g diego3g left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is .prettierrc really necessary? I think ESLint or Prettier are not configured the best way inside your editor.

Look that prettier removed , at the end of objects and arrays but it's a rule of AirBnB style guide to keep this.

Also, since #71 we should't need an .prettierrc.

Can you take a look at this? The implementation is ready to merge but we need to keep the style guide.

@danilomartinelli

danilomartinelli commented May 24, 2019

Copy link
Copy Markdown
Contributor Author

Is .prettierrc really necessary? I think ESLint or Prettier are not configured the best way inside your editor.

Look that prettier removed , at the end of objects and arrays but it's a rule of AirBnB style guide to keep this.

Also, since #71 we should't need an .prettierrc.

Can you take a look at this? The implementation is ready to merge but we need to keep the style guide.

When I make a commit without .prettierrc, the lint-staged changes all single quotes to double quotes.

@pellizzetti

Copy link
Copy Markdown
Contributor

Hi @danilomartinelli could you merge master to your branch and resolve the conflicts? We made some changes regarding prettier (we even included a .prettierrc too).

@danilomartinelli

Copy link
Copy Markdown
Contributor Author

Hi @danilomartinelli could you merge master to your branch and resolve the conflicts? We made some changes regarding prettier (we even included a .prettierrc too).

Done :)

@diego3g diego3g self-requested a review June 3, 2019 10:32
@diego3g diego3g merged commit e8bc1a6 into unform:master Jun 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants