-
Notifications
You must be signed in to change notification settings - Fork 47.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#9712] fix <input type="number" /> value '.98' should not be equal t…
…o '0.98'. (#9714) * [#9712] fix <input type="number" /> value ".98" should not be equal to "0.98". * fix eslint error * fix label error
- Loading branch information
1 parent
3daabf1
commit 8ab56e5
Showing
6 changed files
with
78 additions
and
4 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
fixtures/dom/src/components/fixtures/number-inputs/NumberInputDecimal.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const React = window.React; | ||
|
||
import Fixture from '../../Fixture'; | ||
|
||
class NumberInputDecimal extends React.Component { | ||
state = { value: '.98' }; | ||
changeValue = () => { | ||
this.setState({ | ||
value: '0.98', | ||
}); | ||
} | ||
render() { | ||
const {value} = this.state; | ||
return ( | ||
<Fixture> | ||
<div>{this.props.children}</div> | ||
|
||
<div className="control-box"> | ||
<input | ||
type="number" | ||
value={value} | ||
onChange={(e) => { | ||
this.setState({value: e.target.value}); | ||
}} | ||
/> | ||
<button onClick={this.changeValue}>change.98 to 0.98</button> | ||
</div> | ||
</Fixture> | ||
); | ||
} | ||
} | ||
|
||
export default NumberInputDecimal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters