Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2754 +/- ##
===========================================
- Coverage 86.65% 66.44% -20.22%
===========================================
Files 816 812 -4
Lines 43754 43783 +29
Branches 11186 11197 +11
===========================================
- Hits 37914 29090 -8824
- Misses 5493 13660 +8167
- Partials 347 1033 +686
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
collaborative-learning
|
||||||||||||||||||||||||||||
| Project |
collaborative-learning
|
| Branch Review |
chip-deselection-bug
|
| Run status |
|
| Run duration | 02m 58s |
| Commit |
|
| Committer | Scott Cytacki |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
4
|
| View all changes introduced in this branch ↗︎ | |
| * This allows toolbar buttons to access the selection that was active when the | ||
| * user clicked on them, even though clicking the toolbar causes the editor to blur. |
There was a problem hiding this comment.
The canonical way to handle this is to have toolbar buttons activate on MouseDown/PointerDown and then preventDefault(), because it's the Click event that triggers the focus change.
| const selectedVariableRef = useRef<typeof selectedVariable>(undefined); | ||
| if (selectedVariable) { | ||
| selectedVariableRef.current = selectedVariable; | ||
| } |
There was a problem hiding this comment.
We do this all the time, so there's no necessary reason to change it, but technically, this makes the component impure because setting a ref is a side effect. The canonical way to do this would be:
| const selectedVariableRef = useRef<typeof selectedVariable>(undefined); | |
| if (selectedVariable) { | |
| selectedVariableRef.current = selectedVariable; | |
| } | |
| const selectedVariableRef = useRef(selectedVariable); | |
| useEffect(() => { | |
| if (selectedVariable) { | |
| selectedVariableRef.current = selectedVariable; | |
| } | |
| }, [selectedVariable]) |
No description provided.