Skip to content

Fix #14319 Add parse float for steps less than 1#14320

Closed
benjaminritner wants to merge 1 commit intoWordPress:masterfrom
benjaminritner:14319_fix_range_control
Closed

Fix #14319 Add parse float for steps less than 1#14320
benjaminritner wants to merge 1 commit intoWordPress:masterfrom
benjaminritner:14319_fix_range_control

Conversation

@benjaminritner
Copy link
Copy Markdown

Description

I added a check to see if the step property is set to less then 1. If so to change the newNumericValue variable to use parseFloat.

on line 51 changed this:

const newNumericValue = parseInt( newValue, 10 );

to this:

let newNumericValue = parseInt( newValue, 10 );
if ( props.step !== undefined && props.step < 1 ) {
	newNumericValue = parseFloat( newValue );
}

How has this been tested?

Checked with all core blocks, as well as all Kadence Blocks :)

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.

@benjaminritner
Copy link
Copy Markdown
Author

This should be dropped for #14322

This was only a way to make things work, 14322 is a real step forward.

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

Successfully merging this pull request may close these issues.

1 participant