Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kylemath opened this issue Jan 17, 2020 · 0 comments
Assignees

Comments

@kylemath
Copy link
Owner

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();
    });
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants