Skip to content

Commit 03d5adc

Browse files
committed
fix: snap points bug
fixed a bug with completeFixedSnapValues that was adding min and max to fixedSnapValues even when snapValues were not specified
1 parent 3fce90c commit 03d5adc

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "svelte-knobs",
3-
"description": "Svelte component library for building customizable knob controls.",
4-
"version": "0.0.1",
3+
"description": "Svelte component library for building customizable knob controls.",
4+
"version": "0.0.2",
55
"repository": {
66
"url": "https://github.com/eye-wave/svelte-knobs"
77
},

src/lib/Knob.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
// preventing the user from selecting that value
3838
function completeFixedSnapValues(snapValues: number[]) {
3939
if (param.type === 'enum-param') return [];
40+
if (snapValues.length < 1) return [];
4041
4142
const { min: start, max: end } = param.range;
4243
const clone = [...snapValues];

0 commit comments

Comments
 (0)