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

fix(expandable): add type to the button #1982

Merged
merged 4 commits into from
Jun 27, 2019

Conversation

christiemolloy
Copy link
Member

close #1980

I think the problem was that there was no "type" set on the toggle button in the expandable component, so when it was added to a form the type defaulted to submit.

I think its safe to add the type as button to this component because I couldnt see it being a reset/submit type.

Maybe we should also evaluate the variations of the button component.

@patternfly-build
Copy link

patternfly-build commented Jun 25, 2019

Deploy preview for pf-next ready!

Built with commit 50f2d61

https://deploy-preview-1982--pf-next.netlify.com

Copy link
Contributor

@mattnolting mattnolting left a comment

Choose a reason for hiding this comment

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

@christiemolloy I concur. Should we also add {{#if button--IsSubmit}} type="submit"{{/if}}{{#if button--IsReset}} type="reset"{{/if}} to the button component and update form component button examples?

@srambach
Copy link
Member

I agree with @mattnolting - let's add this to the button component. And should we add type="button" on a button by default then?

@christiemolloy
Copy link
Member Author

Updated @srambach and @mattnolting

@@ -5,6 +5,9 @@ Always add a modifier class to add color to the button.
## Button vs link
Semantic buttons and links are important for usability as well as accessibility. Using an `a` instead of a `button` element to perform user initiated actions should be avoided, unless absolutely necessary.

## Button Types
The default type for a button is button, which must be set to avoid having a button in a form incorrectly default to type "submit". If a button is used in a submit form, the type should be set to "submit". If a button is used to reset a form, the type should be set to "reset".
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to include this statement here? The type attribute is documented on MDN as standard html, and not specific to patternfly. And the statement about what the default is is specific to our handlebar, but is not something our consumers would care about.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed I honestly wasn't too sure about putting it in but wanted to see what others thought.

Copy link
Contributor

@jgiardino jgiardino left a comment

Choose a reason for hiding this comment

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

These updates look good! I just have one tiny nit about the documentation section that was added, but the rest looks great.

Copy link
Member

@srambach srambach left a comment

Choose a reason for hiding this comment

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

bitmoji

@mattnolting mattnolting merged commit b0732f6 into patternfly:master Jun 27, 2019
@patternfly-build
Copy link

🎉 This PR is included in version 2.15.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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 this pull request may close these issues.

5 participants