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

[EuiColorStops] Step value must be greater or equal to 1 #4761

Closed
dej611 opened this issue Apr 27, 2021 · 6 comments
Closed

[EuiColorStops] Step value must be greater or equal to 1 #4761

dej611 opened this issue Apr 27, 2021 · 6 comments

Comments

@dej611
Copy link
Contributor

dej611 commented Apr 27, 2021

While testing the EuiColorStops for the Lens editor we found out that the minimum step allowed by the component must be greather or equal to 1.
While there are workarounds to this, it would be useful to handle this internally within the component.

The user case that showed the bug was relative to percentage values, where min and max where set based on the data (for instance 0 - 0.92), and stops where mapped within that range. This triggered the bug:

Uncaught Error: The value of 0.9391536673440342 is not included in the possible sequence provided by the step of 1.
    at EuiRangeTrack.validateValueIsInStep (range_track.js:84)
    at EuiRangeTrack.render (range_track.js:149)
    at finishClassComponent (react-dom.development.js:18470)
    at updateClassComponent (react-dom.development.js:18423)
    at beginWork$1 (react-dom.development.js:20186)
    at HTMLUnknownElement.callCallback (react-dom.development.js:336)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:385)
    at invokeGuardedCallback (react-dom.development.js:440)
    at beginWork$$1 (react-dom.development.js:25780)
    at performUnitOfWork (react-dom.development.js:24695)
@dej611 dej611 added the bug label Apr 27, 2021
@thompsongl
Copy link
Contributor

Makes sense. It should just be a simple prop (rangeSteps?) that gets passed to the internal components that would use it: EuiRangeTrack, EuiColorStopThumb (arrow key fn, and valueInputProps).

@hetanthakkar
Copy link
Contributor

hetanthakkar commented May 26, 2021

@thompsongl I don't understand your approach! Can you please elaborate slightly more on the purpose of introducing new prop rangeSteps

@thompsongl
Copy link
Contributor

The value of the new rangeSteps prop needs to be passed to the internal components and functions that currently assume a step value of 1:


(The valueInputProps object needs to have a step property)

Might be other locations, also, but these are the ones I know of without getting to code.

@andrmaz
Copy link

andrmaz commented Oct 21, 2023

@thompsongl Is this issue still open ? I would like to give it a try

@JasonStoltz
Copy link
Member

@andrmaz EuiColorStops has been deprecated, you can check our Deprecation Schedule here. In light of that, I'm going to close this issue as "Not planned". Thank you for your interest in contributing!

@JasonStoltz JasonStoltz closed this as not planned Won't fix, can't repro, duplicate, stale Oct 23, 2023
@andrmaz
Copy link

andrmaz commented Oct 23, 2023

@JasonStoltz Noted! Thanks for letting me know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants