-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
17051 - migrated Checkbox to PressableWithFeedback #20257
Conversation
@marcaaron Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Will be working on C+ review |
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 will be working on C+ review
@Skalakid Kindly fill the Offline test and QA Steps section. If its same as the test, then add "Same as Tests" in the section. |
src/components/Checkbox.js
Outdated
@@ -45,6 +49,7 @@ const defaultProps = { | |||
forwardedRef: undefined, | |||
children: null, | |||
onMouseDown: undefined, | |||
accessibilityLabel: 'checkbox', |
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 the default accessibilityLabel be empty string? Since it will not be useful to read out checkbox without context in case of default is not useful?
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.
Good point, I will change that
src/components/Checkbox.js
Outdated
disabled={this.props.disabled} | ||
onPress={this.firePressHandlerOnClick} | ||
onMouseDown={this.props.onMouseDown} | ||
onFocus={this.onFocus} | ||
onBlur={this.onBlur} | ||
ref={this.props.forwardedRef} | ||
onPressOut={this.onBlur} | ||
style={this.props.style} | ||
style={[this.props.style, styles.userSelectNone]} |
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.
And any reason to not allow user to select the checkbox text?
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.
Previously after double-clicking the checkbox icon was somehow selectable, now after I merged the latest main I can't reproduce it so I can remove it
src/components/Checkbox.js
Outdated
style={this.props.style} | ||
onKeyDown={this.handleSpaceKey} | ||
accessibilityRole="checkbox" | ||
accessibilityState={{ | ||
checked: this.props.isChecked, | ||
}} | ||
accessibilityLabel={this.props.accessibilityLabel} | ||
hoverDimmingValue={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.
can we remove this? Since currently the default for hoverDimmingValue is 1?
src/components/Checkbox.js
Outdated
disabled={this.props.disabled} | ||
onPress={this.firePressHandlerOnClick} | ||
onMouseDown={this.props.onMouseDown} | ||
ref={this.props.forwardedRef} | ||
onPressOut={this.onBlur} |
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.
@Skalakid What is this this.onBlur
? I always get undefined value for 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.
@Skalakid any update 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.
@abdulrahuman5196 Hey, sorry for the late response, I just fixed this by merging with the main ;) I think it was added after merging with main, now it's gone
@Skalakid The eye icon on the password entry field of pdf attachment is moved up due to this change. Steps
main branch this PR with PressableWithFeedback |
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-06-22.at.5.57.11.PM.mp4Mobile Web - Chromeaz_recorder_20230622_175907.mp4Mobile Web - Safariios.safari.1.mp4DesktopScreen.Recording.2023-06-22.at.6.16.26.PM.mp4iOSScreen.Recording.2023-06-22.at.6.11.21.PM.mp4Androidaz_recorder_20230622_182104.mp4 |
src/components/Checkbox.js
Outdated
@@ -34,6 +35,9 @@ const propTypes = { | |||
|
|||
/** A ref to forward to the Pressable */ | |||
forwardedRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({current: PropTypes.instanceOf(React.Component)})]), | |||
|
|||
/** A ref to forward to the Pressable */ |
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.
@Skalakid Wrong type comment here. Could you update 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.
Changes looks good and works well. Reviewers checklist is also complete.
All yours @marcaaron
🎀👀🎀
C+ Reviewed
8c250cf
to
56b01f4
Compare
Gonna unassign myself from reviews here as @roryabraham is managing this project and I think as the assignee to the original issue is the "correct reviewer". That said, if you need an extra set of eyes let me know and I'll be happy to jump back in! |
@Skalakid Can you resolve conflicts here please? |
@roryabraham looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
Not an emergency, was just too trigger-happy with the merge button and my approval kicked off a new check for the checklist |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/roryabraham in version: 1.3.35-0 🚀
|
🚀 Deployed to production by https://github.com/Julesssss in version: 1.3.35-5 🚀
|
1 similar comment
🚀 Deployed to production by https://github.com/Julesssss in version: 1.3.35-5 🚀
|
@@ -67,7 +71,7 @@ function Checkbox(props) { | |||
}; | |||
|
|||
return ( | |||
<Pressable | |||
<PressableWithFeedback | |||
disabled={props.disabled} |
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 a heads-up that this has caused a small regression in #22413
BaseGenericPressable
didn't have the logic to disable onKeyDown
handler when disabled
prop is true
We resolved this by adding the following condition
onKeyDown={!isDisabled ? onKeyDown : undefined}
Details
Fixed Issues
$ #17051
PROPOSAL: #17051
Tests
Settings
>Payments
Add payment method
Debit card
I accept the Expensify Terms of Service
, verify styling and behaviorOffline tests
Same as Tests
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
web.mov
Mobile Web - Chrome
mWeb-chrome.mov
Mobile Web - Safari
mWeb-safari.mov
Desktop
desktop.mov
iOS
ios.mov
Android
android.mov