-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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(dialog): Cancel open's rAF when close is called #4087
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4087 +/- ##
=========================================
Coverage ? 98.67%
=========================================
Files ? 126
Lines ? 5603
Branches ? 746
=========================================
Hits ? 5529
Misses ? 74
Partials ? 0
Continue to review full report at Codecov.
|
All 663 screenshot tests passed for commit ff2aa07 vs. |
All 663 screenshot tests passed for commit bc933e4 vs. |
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!
Confirmed that this also works in #4081. Thanks Ken!
All 663 screenshot tests passed for commit 205e90b vs. |
All 663 screenshot tests passed for commit 10cbc71 vs. |
This fixes a bug in Dialog when
open()
andclose()
are called on the same frame, where the dialog is visually open but internally its state says it's closed, which then makesclose()
do nothing on subsequent calls.I discovered this in the wake of Abhinay discovering an issue with the current snackbar JS PR (#4081), after he fixed a similar type of issue for Drawer (#4078). We're probably going to model snackbar off of dialog, so I wanted to make sure that worked.
To repro the original issue using this branch:
#close
npm start
(This issue only happens on the same frame, due to neglecting to cancel
#open
's rAF.)