Skip to content

Commit

Permalink
fix(InputNumber): allow float numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
N00nDay committed Nov 21, 2023
1 parent d26db97 commit e1d56f9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions src/lib/components/input-number/InputNumber.svelte
Expand Up @@ -28,9 +28,9 @@
let currentError: Writable<string | undefined> = writable(error);
$: currentError.set(error);
function onlyNumeric(e: KeyboardEvent) {
if (!e.key.match(/^[0-9]+$/)) e.preventDefault();
}
// function onlyNumeric(e: KeyboardEvent) {
// if (!e.key.match(/^[0-9]+$/)) e.preventDefault();
// }
function handleClear() {
input.value = '';
Expand Down Expand Up @@ -105,7 +105,6 @@
bind:value
{step}
on:input
on:keypress={onlyNumeric}
{min}
{max}
/>
Expand Down

1 comment on commit e1d56f9

@vercel
Copy link

@vercel vercel bot commented on e1d56f9 Nov 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

stwui – ./

stwui.vercel.app
stwui-n00nday.vercel.app
stwui-git-main-n00nday.vercel.app

Please sign in to comment.