Skip to content

Commit

Permalink
Merge pull request #177 from alley-rs/main
Browse files Browse the repository at this point in the history
0.3.10
  • Loading branch information
thep0y authored Dec 2, 2024
2 parents ba4d63b + ed49a95 commit 752d606
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "alley-components",
"version": "0.3.9",
"version": "0.3.10",
"repository": "https://github.com/alley-rs/alley-components",
"keywords": [
"solid",
Expand Down
5 changes: 2 additions & 3 deletions packages/components/input-number/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,8 @@ const InputNumber = (props: InputNumberProps) => {
};

const validNumber = (value: string): number => {
const n = Number.parseInt(value);

return n;
const n = Number.parseFloat(value);
return Number.isNaN(n) ? 0 : n;
};

export default InputNumber;
5 changes: 5 additions & 0 deletions src/components/inputs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ const Inputs = () => {
</Space.Compact>
</Space>

<Space align="center">
<Label>可输入负数</Label>
<InputNumber value={count()} onChange={setCount} min={-100} />
</Space>

<Space align="center">
<Label>紧凑模式(大)</Label>
<Space.Compact size="large">
Expand Down

0 comments on commit 752d606

Please sign in to comment.