palantir/blueprint
在 GitHub 查看NumericInput controlled mode warns about invalid value too often
Open
#4,327 建立於 2020年9月10日
P2Package: coreType: enhancementhelp wanted
倉庫指標
- Star
- (20,263 star)
- PR 合併指標
- (平均合併 43天 10小時) (30 天內合併 27 個 PR)
描述
Environment
- Package version(s): core 3.31.0
Steps to reproduce
- set up
<NumericInput value={this.state.value} onChange={(_v, value) => this.setState({ value })) /> - type
0.
Actual behavior
in dev mode, the component complains that
<NumericInput> controlled value prop does not adhere to stepSize, min, and/or max constraints.

Expected behavior
this should be allowed. what it actually means is that the string passed was not a full numeric entity, but it can still be parsed as a valid number, so it's ok.
Possible solution
change the validation logic