Skip to content

Commit

Permalink
Fix vm.Slider and vm.RangeSlider to work with incorrect textual input
Browse files Browse the repository at this point in the history
  • Loading branch information
petar-qb committed Nov 14, 2023
1 parent d0a27ce commit e977fa0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions vizro-core/src/vizro/static/js/models/range_slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ export function _update_range_slider_values(
trigger_id === `${self_data["id"]}_start_value` ||
trigger_id === `${self_data["id"]}_end_value`
) {
if (isNaN(start) || isNaN(end)) {
return dash_clientside.no_update;
}
[start_text_value, end_text_value] = [start, end];
} else if (trigger_id === self_data["id"]) {
[start_text_value, end_text_value] = [slider[0], slider[1]];
Expand Down
3 changes: 3 additions & 0 deletions vizro-core/src/vizro/static/js/models/slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ export function _update_slider_values(start, slider, input_store, self_data) {
dash_clientside.callback_context.triggered[0]["prop_id"].split(".")[0];
}
if (trigger_id === `${self_data["id"]}_text_value`) {
if (isNaN(start)) {
return dash_clientside.no_update;
}
text_value = start;
} else if (trigger_id === self_data["id"]) {
text_value = slider;
Expand Down

0 comments on commit e977fa0

Please sign in to comment.