-
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
Fix Unlink button can be clicked once again after get disabled #21373
Fix Unlink button can be clicked once again after get disabled #21373
Conversation
const propsWithoutWrapperStyles = _.omit(props, omittedProps); | ||
const [disabled, setDisabled] = useState(props.disabled); | ||
const [isPressed, setIsPressed] = useState(false); | ||
const [isPressed, setPressed] = useState(false); | ||
const [isPressedIn, setPressedIn] = useState(false); |
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 you revert the isPressed
, setIsPressed
logic? Instead find a new variable name for the other logic (you ask in Slack for some ideas)
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 you mean to find a new name for both isPressed and isPressedIn? Or
isPressedIn -> isPressed
isPressed -> find a new 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.
(the second one)
We already have a isPressed state. Let's keep it
Find a new name for the other state
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.
Renamed. Got the name from ChatGPT 😄
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 good
useEffect(() => { | ||
setDisabled(props.disabled); | ||
}, [props.disabled]); | ||
const isDisabled = useMemo(() => props.disabled || isPressed, [props.disabled, isPressed]); |
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 don't need useMemo here, the logic is simple enough to just recalculate it
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.
You're right. Updated!
const [disabled, setDisabled] = useState(props.disabled); | ||
const [isPressed, setIsPressed] = useState(false); | ||
const [isExecuting, setExecuting] = useState(false); | ||
const [isPressed, setPressed] = useState(false); |
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.
Revert this. It was isPressed, setIsPressed
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.
Updated 👍
@@ -39,25 +39,22 @@ const PressableWithFeedbackDefaultProps = { | |||
|
|||
const PressableWithFeedback = forwardRef((props, ref) => { | |||
const propsWithoutWrapperStyles = _.omit(props, omittedProps); | |||
const [disabled, setDisabled] = useState(props.disabled); | |||
const [isPressed, setIsPressed] = useState(false); | |||
const [isExecuting, setExecuting] = useState(false); |
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.
Should be setIsExecuting not setExecuting
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.
Updated 👍
Reviewer Checklist
Screenshots/VideosWebweb.mp4Mobile Web - Chromemweb-chrome.mp4Mobile Web - Safarimweb-safari.mp4Desktopdesktop.mp4iOSios.mp4Androidandroid.mp4 |
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.
LGTM! 🚀
🎀 👀 🎀 C+ reviewed
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.
LGTM!
✋ 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/johnmlee101 in version: 1.3.33-0 🚀
|
🚀 Deployed to production by https://github.com/thienlnam in version: 1.3.33-4 🚀
|
Details
Unlink button will be disabled while loading and after the request is completed. Currently, we can click once again even though it looks disabled.
Fixed Issues
$ #20983
PROPOSAL: #20983 (comment)
Tests
Same as QA Steps
Offline tests
Requires internet connection
QA Steps
Prerequisites: have an unverified secondary login
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
Screen.Recording.2023-06-23.at.12.31.52.mov
Mobile Web - Chrome
Screen.Recording.2023-06-23.at.12.36.51.mov
Mobile Web - Safari
Screen.Recording.2023-06-23.at.12.33.38.mov
Desktop
Screen.Recording.2023-06-23.at.12.33.58.mov
iOS
Screen.Recording.2023-06-23.at.12.32.50.mov
Android
Screen.Recording.2023-06-23.at.12.35.54.mov