Skip to content

Commit

Permalink
[Interactive Graph: Circle] Add a key prop to the circle drag handle (#…
Browse files Browse the repository at this point in the history
…1388)

## Summary:
There's always a console error saying that the circle graph drag handle
is missing the `key` prop.

Adding a `key` here.

Issue: none

## Test plan:
Open the console and make sure the error isn't showing up anymore.

`yarn jest packages/perseus/src/widgets/__tests__/interactive-graph.test.ts`
Make sure the logs don't show the console error anymore.

<img width="494" alt="Screenshot 2024-07-01 at 3 10 31 PM" src="https://github.com/Khan/perseus/assets/13231763/2e3cd2cd-7c08-4527-9fcb-aa02b096189f">

Author: nishasy

Reviewers: benchristel, catandthemachines

Required Reviewers:

Approved By: benchristel, catandthemachines

Checks: ✅ codecov/project, ✅ codecov/patch, ✅ Upload Coverage (ubuntu-latest, 20.x), ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Cypress (ubuntu-latest, 20.x), ✅ Jest Coverage (ubuntu-latest, 20.x), ✅ Check builds for changes in size (ubuntu-latest, 20.x), ✅ Lint, Typecheck, Format, and Test (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), 🚫 Upload Coverage, ✅ gerald, 🚫 Publish npm snapshot (ubuntu-latest, 20.x), 🚫 Lint, Typecheck, Format, and Test (ubuntu-latest, 20.x), 🚫 Cypress (ubuntu-latest, 20.x), 🚫 Check for .changeset entries for all changed files (ubuntu-latest, 20.x), 🚫 Jest Coverage (ubuntu-latest, 20.x), ✅ Publish Storybook to Chromatic (ubuntu-latest, 20.x), 🚫 Check builds for changes in size (ubuntu-latest, 20.x), ✅ gerald

Pull Request URL: #1388
  • Loading branch information
nishasy authored Jul 1, 2024
1 parent 30f898c commit 94067d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/sour-cougars-draw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@khanacademy/perseus": patch
---

[Interactive Graph: Circle] Add a key prop to the circle drag handle
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ function DragHandle(props: {center: [x: number, y: number]}) {
const [xPx, yPx] = vec.add(offsetPx, centerPx);
return (
<circle
key={`circle-${xPx}-${yPx}`}
className="movable-circle-handle-dot"
cx={xPx}
cy={yPx}
Expand Down

0 comments on commit 94067d7

Please sign in to comment.