Fix onMouseDown event propagation, unstable gradient IDs, and TypeScript errors#114
Merged
Fix onMouseDown event propagation, unstable gradient IDs, and TypeScript errors#114
Conversation
Co-authored-by: fseehawer <30494175+fseehawer@users.noreply.github.com>
…nents Co-authored-by: fseehawer <30494175+fseehawer@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix identified issues in the code
Fix onMouseDown event propagation, unstable gradient IDs, and TypeScript errors
Mar 6, 2026
fseehawer
approved these changes
Mar 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Several bugs and type errors existed across
Svg,App, and missing type declarations — including a runtime crash path and a React anti-pattern.src/Svg/index.tsxonMouseDown(event)was called asonMouseDown()— dropping the event.CircularSlider.onMouseDowncallsevent.preventDefault()/event.stopPropagation(), so this throws aTypeErrorat runtime whentrackDraggableis enabled and a click is processed mid-drag.Math.random()was called on every render to produce the SVG gradient ID. Moved touseRefso the ID is stable across re-renders — avoids unnecessary reconciliation and flickering in StrictMode.src/App.tsxsliderRefsasReact.useRef<React.RefObject<CircularSliderHandle | null>[]>withcreateRef<CircularSliderHandle>()— fixes the fourref=TS2322 errors and enablesref.current.refresh()access.(index: number)tohandleTabChange— removes implicitany.stylesasRecord<string, React.CSSProperties>— resolves TS2322 on CSS properties (flexWrap,textAlign,overflowX) inferred asstring.border="0"HTML attribute on<input>and<img>withstyle={{ border: 0 }}.src/vite-env.d.ts(new)Added type declaration for
*.svg?reactVite/SVGR imports — resolves TS2307 module-not-found errors forDragIconandEmojiIcon.💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.