-
Notifications
You must be signed in to change notification settings - Fork 3k
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
refactor checkbox with label #7750
refactor checkbox with label #7750
Conversation
Still having issues with desktop app. Will try again after sometime. |
@thesahindia to test on desktop, merge And temporarily create a |
@rushatgabhane, tried both but still it's not showing anything. |
@thesahindia i can't toggle the checkbox. Maybe it's because of regression in |
@rushatgabhane, hadn't implemented that because of getting error while testing due to the regression. It should work now. |
Nope, it doesn't work. I'm unable to toggle checkbox in storybook. |
Yeah I think it might be due to the regression as I had tested and it was working 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.
Looks like this is still needing desktop testing.
@thesahindia please merge |
@rushatgabhane, sure and sorry for the delay. I was waiting to get clarification about adding translation but didn't see it was resolved (don't know why I didn't get a notification for it 🤷♂️) |
…factor-checkbox-with-label merge main
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.
@tgolen LGTM! 🎉
Commenting since I can't edit the PR PR Reviewer Checklist
|
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.
Just noticed this one last thing before merging.
src/components/Checkbox.js
Outdated
@@ -13,27 +13,35 @@ const propTypes = { | |||
onPress: PropTypes.func.isRequired, | |||
|
|||
/** Should the input be styled for errors */ |
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.
Looks like this comment is out-of-date
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.
Earlier we were applying the error styles when hasError
was true, now we are just checking if errorText is present, so the functionality hasn't change and I think we can keep this comment.
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.
@thesahindia "Should the input be styled for errors" gives the impression that it's a boolean.
And we're displaying whatever error is passed.
/** Should the input be styled for errors */ | |
/** Error text to display */ |
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.
@rushatgabhane, Yes makes sense, but now I think a better way would be to keep it as hasError since we are only going to use it as boolean and I will pass it like this -
<Checkbox
hasError={!!props.errorText}
the errorText
that we get in CheckboxWithLabel
is to show the error message and for checkbox component we only need a boolean value
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.
@thesahindia good call. I agree, let's do that.
hasError={Boolean(props.errorText)}
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.
Done ✔️
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.
@tgolen all yours! LGTM
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 that change. I love the removal of hasError
!
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Please create a follow-up PR. Edit: I've created a PR to fix this because it's 3 AM for you |
Thanks for the help 😃 |
🚀 Deployed to production by @chiragsalian in version: 1.1.42-6 🚀
|
Details
Fixed Issues
$ #7531
Tests
QA Steps
Tested On
Screenshots
Web
Screen.Recording.2022-02-15.at.2.34.31.AM.mov
without margin left-

with margin left-
Screen.Recording.2022-02-15.at.2.37.02.AM.mov
Mobile Web
Desktop
iOS
Android