-
Notifications
You must be signed in to change notification settings - Fork 3
Conversation
isSubmit is used to specify if the button is a submit button or not.
isSubmit is used to specify if the button is a submit button or not.
We can determine if it's in a form or not by the name prop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noice
@@ -246,7 +246,7 @@ describe('Hacker component', () => { | |||
}); | |||
|
|||
it('page one is rendered', () => { | |||
expect(wrapper.find('div#hacker-application-page-1')).toHaveLength(1); | |||
expect(wrapper.find('form#hacker-application-page-1')).toHaveLength(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mingyokim an example of the potentially-overly-specific-tests i talked about the other day
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, i get it now. i'll try to avoid these patterns next time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
submit button doesn't work in /login
:/
disabled={disabled} | ||
className={`primary ${className}`}> | ||
className={`primary ${className}`} | ||
form={name}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we really need form
here? It's not submitting even when the type is submit
if form
is defined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, form
was supposed to equal the form-id but I made it the form-name. Fixed by fd5ad1c. The commit also removes this attribute altogether since it's only really useful in the extreme case where you want to associate a button with a form when it's outside the <form>
tags.
The use case for this is pretty rare
It doesn't pick up type defined through defaultProps (since it's dynamic), so we have to set this to warn or disable it altogether.
@@ -22,6 +22,7 @@ | |||
"react/prefer-stateless-function": 0, | |||
"react/no-did-mount-set-state": 0, | |||
"react/jsx-one-expression-per-line": 0, | |||
"react/button-has-type": 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks guys! |
🎟️ Ticket(s): Closes #57
👷 Changes
Just a small refactor of our input components to use the same conventions before we move forward with the rest of the components. Here are the changes:
id
for each component (just the inputname
instead).type
field toPrimaryButton
andSecondaryButton
(see notes).💭 Notes
ForYou can also explicitly define thePrimaryButton
,SecondaryButton
, andProgressGroup
, thename
is optional. For the buttons, the button type becomessubmit
if you provide a value forname
. If you don't provide aname
value, the button type defaults tobutton
.type
(tosubmit
,button
, orreset
with the default beingbutton
) ofPrimaryButton
andSecondaryButton
.