You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Number Input doesn't allow negative numbers. A 'negative' prop would be nice to accept negative numbers.
Example
No response
Your Idea
We can make optional because not every situation need negative values. Can be like this:
value = e.value.replace(negative ? /[^\d^.\-]+/g : /[^\d^.]+/g, '');
The text was updated successfully, but these errors were encountered:
Fixesany-tdf#37
Add support for negative numbers in the Number Input component.
* Add a new `negative` prop to the `Input` component in `packages/stdf/components/input/Input.svelte`.
* Update the `valueChangeFun` function in `packages/stdf/components/input/Input.svelte` to handle negative numbers when the `negative` prop is set.
* Update the `type` prop in `doc/components/input/api_en.md` and `doc/components/input/api.md` to include a 'negative' option.
* Add a description for the `negative` prop in `doc/components/input/api_en.md` and `doc/components/input/api.md`.
* Add examples of the `negative` prop in `demo/src/routes/en_US/input/+page.svelte` and `demo/src/routes/zh_CN/input/+page.svelte`.
---
For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/any-tdf/stdf/issues/37?shareId=XXXX-XXXX-XXXX-XXXX).
Module
stdf (STDF component)
Feature Description
Number Input doesn't allow negative numbers. A 'negative' prop would be nice to accept negative numbers.
Example
No response
Your Idea
We can make optional because not every situation need negative values. Can be like this:
value = e.value.replace(negative ? /[^\d^.\-]+/g : /[^\d^.]+/g, '');
The text was updated successfully, but these errors were encountered: