Spaces:
Runtime error
Runtime error
Minor fix to enable float step value
Browse filesThe 'handle_min_change' and 'handle_max_change' currently parse values to integers preventing the use of float step values (eg step=0.1).
The proposed suggestion enables to have float min/max values such that the step argument acts as in the original Slider gradio component.
src/frontend/Index.svelte
CHANGED
@@ -40,14 +40,14 @@
|
|
40 |
}
|
41 |
|
42 |
function handle_min_change(event) {
|
43 |
-
selected_min =
|
44 |
if (selected_min > selected_max) {
|
45 |
selected_max = selected_min;
|
46 |
}
|
47 |
}
|
48 |
|
49 |
function handle_max_change(event) {
|
50 |
-
selected_max =
|
51 |
if (selected_max < selected_min) {
|
52 |
selected_min = selected_max;
|
53 |
}
|
|
|
40 |
}
|
41 |
|
42 |
function handle_min_change(event) {
|
43 |
+
selected_min = parseFloat(event.target.value);
|
44 |
if (selected_min > selected_max) {
|
45 |
selected_max = selected_min;
|
46 |
}
|
47 |
}
|
48 |
|
49 |
function handle_max_change(event) {
|
50 |
+
selected_max = parseFloat(event.target.value);
|
51 |
if (selected_max < selected_min) {
|
52 |
selected_min = selected_max;
|
53 |
}
|