Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
statepicker refactored to compatible with form #8758
statepicker refactored to compatible with form #8758
Changes from 4 commits
ee883a3
0aba0ff
339d441
9e93cda
cee55cb
3a09b5c
a8d30f4
cae92e8
7597a8a
2349a7c
dcdb112
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
The
incorporationState
key is not defined here.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.
Shouldn't we remove these?
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 for pointing out these changes, Yes I need to change all these places where we are using StatePicker,
App/src/pages/ReimbursementAccount/AddressForm.js
Line 75 in ad637d3
App/src/pages/ReimbursementAccount/CompanyStep.js
Line 292 in ad637d3
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.
Please add a top margin like the other inputs
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.
we have not defined a style prop for StatePicker, we need to create containerStyles prop here
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.
or you can just wrap it in a View like we do in all calls of
StatePicker
, e.g.App/src/pages/ReimbursementAccount/CompanyStep.js
Lines 287 to 294 in fdd741f
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.
Ohkay
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.
Can we also add a non-empty default value for
pickState
here?During my testing, the default value didn't seem to work properly on page load.
storybook.mov
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.
I think we have to add 1 more prop in StatePicker for this change, we need to pass defaultValue to make it work
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.
I have added a default value for pickState, but we also have to pass defaultValue in StatePicker component, please let me know your thought on this
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.
That sounds similar to what I'm doing in the Datepicker refactor. If that's the case I think it's fine :)
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.
Okay, then its fine
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.
Hmm the default value still doesn't load for me. Can you please check?
default.mov
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.
@luacmartins we need to pass defaultValue as a prop in StatePicker here
https://github.com/jayeshmangwani/App/blob/a8d30f4de9ac1638f45eae693710b3069aa7f4f3/src/components/StatePicker.js#L42-L44
defaultValue={props.defaultValue}
as this value is being used in the BasePicker
https://github.com/jayeshmangwani/App/blob/a8d30f4de9ac1638f45eae693710b3069aa7f4f3/src/components/Picker/BasePicker/index.js#L14