-
Notifications
You must be signed in to change notification settings - Fork 14k
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: Preserves selected scopes when toggling between scope types #23475
fix: Preserves selected scopes when toggling between scope types #23475
Conversation
Codecov Report
@@ Coverage Diff @@
## master #23475 +/- ##
==========================================
+ Coverage 67.64% 67.65% +0.01%
==========================================
Files 1908 1910 +2
Lines 73739 73747 +8
Branches 7988 7988
==========================================
+ Hits 49879 49894 +15
+ Misses 21814 21811 -3
+ Partials 2046 2042 -4
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@@ -78,10 +80,13 @@ const FilterScope: FC<FilterScopeProps> = ({ | |||
|
|||
const onUpdateFormValues = useCallback( | |||
(formValues: any) => { | |||
if (formScopingType === ScopingType.specific) { | |||
setLastSpecificScope(formValues.scope); |
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 personally prefer to use useRef
for this case (since it won't need to re-render)
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 call! 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.
Thanks for updates
…che#23475) (cherry picked from commit 80d1e4f)
SUMMARY
Preserves selected scopes when toggling between scope types.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Screen.Recording.2023-03-23.at.13.54.34.mov
Screen.Recording.2023-03-23.at.13.51.03.mov
TESTING INSTRUCTIONS
Make sure the selected scopes are preserved when toggling between scope types
ADDITIONAL INFORMATION