Skip to content

Commit

Permalink
fix: snap points bug
Browse files Browse the repository at this point in the history
fixed a bug with completeFixedSnapValues that was adding min and max to fixedSnapValues even when snapValues were not specified
  • Loading branch information
eye-wave committed Oct 22, 2024
1 parent 3fce90c commit 03d5adc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "svelte-knobs",
"description": "Svelte component library for building customizable knob controls.",
"version": "0.0.1",
"description": "Svelte component library for building customizable knob controls.",
"version": "0.0.2",
"repository": {
"url": "https://github.com/eye-wave/svelte-knobs"
},
Expand Down
1 change: 1 addition & 0 deletions src/lib/Knob.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
// preventing the user from selecting that value
function completeFixedSnapValues(snapValues: number[]) {
if (param.type === 'enum-param') return [];
if (snapValues.length < 1) return [];
const { min: start, max: end } = param.range;
const clone = [...snapValues];
Expand Down

0 comments on commit 03d5adc

Please sign in to comment.