mayalenE commited on
Commit
2f5db87
·
verified ·
1 Parent(s): 57be732

Minor fix to enable float step value

Browse files

The '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.

Files changed (1) hide show
  1. src/frontend/Index.svelte +2 -2
src/frontend/Index.svelte CHANGED
@@ -40,14 +40,14 @@
40
  }
41
 
42
  function handle_min_change(event) {
43
- selected_min = parseInt(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 = parseInt(event.target.value);
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
  }