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

Recent update breaks RangeControl step #14319

Closed
kadencewp opened this issue Mar 7, 2019 · 2 comments
Closed

Recent update breaks RangeControl step #14319

kadencewp opened this issue Mar 7, 2019 · 2 comments
Labels
[Feature] UI Components Impacts or related to the UI component system [Package] Components /packages/components [Type] Bug An existing feature does not function as intended

Comments

@kadencewp
Copy link
Contributor

Describe the bug
Pull request #12952 breaks the ability to use a step less than 1. For example, if you set the step to 0.1 you can't slide the slider to anything but whole numbers.

Being able to set the range control step is really useful for inputs that control opacity, em units etc...

This change from pull request #12952 breaks several controls in Kadence Blocks.

To Reproduce
Steps to reproduce the behavior:

  1. Add a Range control and define the step as 0.1
  2. Try to use that range control.

Expected behavior
The range control should allow the steps to be whatever is set through the properties of the input.

Desktop (please complete the following information):
Any - all.

Additional context
A simple workaround to keep the new functionality added with pull request #12952 would be to change line 52 to this instead:

let newNumericValue = parseInt( newValue, 10 );
if ( props.step !== undefined && props.step < 1 ) {
     newNumericValue = parseFloat( newValue );
}
@chrisvanpatten chrisvanpatten added [Feature] UI Components Impacts or related to the UI component system [Package] Components /packages/components [Type] Bug An existing feature does not function as intended labels Mar 7, 2019
@chrisvanpatten
Copy link
Contributor

Great report @kadencethemes. Any chance you could open a PR for the fix you suggested?

@kadencewp
Copy link
Contributor Author

Added pull #14320

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] UI Components Impacts or related to the UI component system [Package] Components /packages/components [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

2 participants