baseweb icon indicating copy to clipboard operation
baseweb copied to clipboard

[Input] Step property in typescript

Open Kyotay opened this issue 4 years ago • 1 comments

Hello everyone,

First of all sorry if it's not the right place for ask this question.

I work with baseweb on a React project in typescript and I encounter an issue, I can't assign to the step property the value 'any', because step accept only number or undefined. So I wonder how I can do this cleanly, in my exemple I need to enter a number with 1 or more number after the dot and the step option with usage like this "step={0.01} only accept value like 0.01 not more or less. Bassically what i'd like to do is step={0.01} or step='any'

Thanks for your time, I hope its enought clear, don't hesitate to ask me more details !

Kyotay avatar Apr 06 '21 07:04 Kyotay

I'm not sure I fully understand your use case. The step value is required to be a number, since it is defining the step increment when used with a number input. "any" is not a valid increment, since it's not a number. Not setting step (or setting step to be undefined) results in the step default of 1.

Here's an example https://codesandbox.io/s/8sz1g?module=src/example.js&file=/src/example.js

williamernest avatar Apr 28 '21 17:04 williamernest