Skip to content

The sliders last value is not used to update the charts, but the value before that, callback race problem #125

@kylemath

Description

@kylemath

Describe the bug
When adjusting sliders, the data shows the second to last values selected, instead of the last

To Reproduce
Go to raw data, adjust sliders,

Expected behavior
should update charts to newest possible settings

I think it is a race problem where the callback is not complete at setting the new settings before the pipe gets recreated with the old settings, similar to this problem: https://stackoverflow.com/questions/30550314/react-input-range-slider-not-propagating-last-value-to-its-owner-in-chrome

  function handleIntervalRangeSliderChange(value) {
    setSettings(prevState => ({...prevState, interval: value}));
    resetPipeSetup();
  }

so resetPipeSetup() runs before setSettings is done, I tried something like this but setSettings can only have one callback:

  function handleIntervalRangeSliderChange(value) {
    setSettings(prevState => ({...prevState, interval: value}), function () {
      resetPipeSetup();
    });
  }

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions